Forum Discussion
How to convert to DAX !!
Hi
Could you please convert below two Cognos Case statements to convert to calculated column of DAX in Power BI.
Please help me asap. Thanks in Advance.
1
case
when ( [Year] ='CY' and [SKU Status]='Active' )
then
( [SKU Count] )
else ( 0 )
end
2
CASE WHEN ( [Year]='CY' )
THEN ([Invoice Cases])
ELSE (0)
END
anjanikumar , Use Switch
Switch ( True() ,
[Year] ="CY" && [SKU Status]="Active" , [SKU Count] ,
0 )2
Switch(True() ,
[Year]=" CY" , [Invoice Cases] ,
0 )
Switch- the Case statement of #PowerBI: https://www.youtube.com/watch?v=gelJWktlR80&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=56
2 Replies
- amitchandak
Super User
anjanikumar , Use Switch
Switch ( True() ,
[Year] ="CY" && [SKU Status]="Active" , [SKU Count] ,
0 )2
Switch(True() ,
[Year]=" CY" , [Invoice Cases] ,
0 )
Switch- the Case statement of #PowerBI: https://www.youtube.com/watch?v=gelJWktlR80&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=56 - v-chenwuz-msft
Community Support
Hi anjanikumar ,
Has your problem been solved, if not, please refer to the following.
1
if( [Year] = 'CY' && [SKU Status] = 'Active', [SKU Count],0 )2
if( [Year] ='CY' , [Invoice Cases], 0)Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.