cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Anonymous
Not applicable

Re: CASE STATEMENT TO DAX?

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
Highlighted
Anonymous
Not applicable

Re: CASE STATEMENT TO DAX?

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

Screenshot_1.png

Highlighted
Anonymous
Not applicable

Re: CASE STATEMENT TO DAX?

@Anonymous 

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

Highlighted
Anonymous
Not applicable

Re: CASE STATEMENT TO DAX?

Highlighted
Anonymous
Not applicable

Re: CASE STATEMENT TO DAX?

CASE in DAX translates into SWITCH.

https://dax.guide/switch/

Best
D

Helpful resources

Announcements
Super Users of the Quarter - Q2 2020

Super Users of the Quarter - Q2 2020

Who are our Super User Superstars? Who made it to the top of the leaderboards? Get the answers!

June 2020 Community Highlights

June 2020 Community Highlights

Featured community members, changes to the Community, and more! Read up on recent Power BI community news.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021