if statement - DAX: if () with check on linked id - Stack Overflow

I have a table of the formidcase status0151 xx0528 yy0454 yy1... ..15

I have a table of the form

id  case status
0    151   xx
0    528   yy
0    454   yy
1    ...   ..
15   ...   ...
...

I am trying to code in DAX something like:

IF id is the same and at least 1 case has status = xx THEN all cases for id = 0 will be xx.

Any help on this?


UPDATE

This works but actually sorry my table is a bit different, didn't give the right example.

My table is more like the belos:

id  case  status
0    1       xx
0    555     yy
0    125     zz
2     87     yy
2     nn     xx

The logic is more like:

for every id if 1 case has status xx and 1 case has status yy, THEN I want yy = xx

So the resulting table would be

id   case    status
0     1        xx
0     555      **xx**
0     125      zz
2     87       **xx**
2     nn       xx

So i don't want all of the status per id to be transformed into xx, but only some of them depending on conditiions.

Thanks

I have a table of the form

id  case status
0    151   xx
0    528   yy
0    454   yy
1    ...   ..
15   ...   ...
...

I am trying to code in DAX something like:

IF id is the same and at least 1 case has status = xx THEN all cases for id = 0 will be xx.

Any help on this?


UPDATE

This works but actually sorry my table is a bit different, didn't give the right example.

My table is more like the belos:

id  case  status
0    1       xx
0    555     yy
0    125     zz
2     87     yy
2     nn     xx

The logic is more like:

for every id if 1 case has status xx and 1 case has status yy, THEN I want yy = xx

So the resulting table would be

id   case    status
0     1        xx
0     555      **xx**
0     125      zz
2     87       **xx**
2     nn       xx

So i don't want all of the status per id to be transformed into xx, but only some of them depending on conditiions.

Thanks

Share Improve this question edited Mar 5 at 15:49 Roberto92 asked Mar 4 at 13:42 Roberto92Roberto92 334 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

you can try this to create a column

Column=
IF (
    MAXX (
        FILTER (
            'Table',
            'Table'[id] = EARLIER ( 'Table'[id] )
                && 'Table'[status] = "xx"
        ),
        'Table'[status]
    ) = "",
    "",
    "xx"
)

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745040437a4607778.html

相关推荐

  • if statement - DAX: if () with check on linked id - Stack Overflow

    I have a table of the formidcase status0151 xx0528 yy0454 yy1... ..15

    9小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信