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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

CASE STATEMENT TO DAX?

Hi Community,

 

I want to convert this CASE STATEMENT SQL Query to DAX?

SQL Query:

1. DayDiff(AddMonths(min(month),3),min(month)) AS tot_days, (Measure 1)

2. CASE WHEN daydiff(Now(),min(month)) > DayDiff(AddMonths(min(month),3),min(month)) THEN DayDiff(AddMonths(min(month),3),min(month)) ELSE daydiff(Now(),min(month)) end AS days_completed (Measure 2)

Is it possible?

 

Reg,

Dhana 

5 REPLIES 5
Anonymous
Not applicable

Everything is possible but without knowing anything about the tabular model, without knowing the tables and relationships involved... not much can be done in this case, I'm afraid.

Best
D
Anonymous
Not applicable

@Anonymous 

give some idea, instead of "Addmonths" what i can use there? I mean alternate DAX function.

Anonymous
Not applicable

CASE in DAX translates into SWITCH.

https://dax.guide/switch/

Best
D
Anonymous
Not applicable

Anonymous
Not applicable

this is the model view (Deals_Active) is my fact table here. Any Idea?

Screenshot_1.png

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors