Forum Discussion
Anonymous
6 years agoNot applicable
Convert DAX Expressions to SQL
I'm a little new to DAX and have a problem! I've been tasked with converting several existing DAX expressions to SQL Server, due to the fact that there are external customers who do not have acce...
Anonymous
6 years agoNot applicable
Thank you! This does the trick...almost!
For the Controllable D0 field, I actually need to wrap the entire thing into a SUM. I've been trying and can't quite get it just right.
Any ideas??
vivran22
6 years agoCommunity Champion
Anonymous
Ideally this should do the trick:
SELECT
SUM(
CASE WHEN 'FlightSchedulePerformanceDetail'[Is Out] = 0 THEN 0
WHEN 'FlightSchedulePerformanceDetail'[Total Departure Delay Minutes] > 0 AND
('FlightSchedulePerformanceDetail'[Dept Delay 1 Controllable] +
'FlightSchedulePerformanceDetail'[Dept Delay 2 Controllable] +
'FlightSchedulePerformanceDetail'[Dept Delay 3 Controllable] +
'FlightSchedulePerformanceDetail'[Dept Delay 4 Controllable] ) > 1
) THEN 0
ELSE 1
END
) as SumTotal
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂 (Hit the thumbs up button!)
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)
https://www.vivran.in/
Connect on LinkedIn