Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
anjanikumar
Helper III
Helper III

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

1 ACCEPTED SOLUTION
amitchandak
Super User
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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
v-chenwuz-msft
Community Support
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.

amitchandak
Super User
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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors