Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi All,
I am trying to replicate the SQL case when statement in the Power BI as a calculated measure.
The SQL statement is
(CASE WHEN 'Target Flag' = 'Actual' AND 'Date.FYear' = '2023'
THEN 'X.var'
ELSE 0
END)
The calculated measure has to SUM the X.var if the above
conditions are true
Solved! Go to Solution.
Hi, @vidheesha ;
Try it.
measure =
IF (
MAX ( [Target Flag] ) = "Actual"
&& MAX ( [Date.FYear] ) = 2023,
SUM ( [X.var] ),
0
)
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @vidheesha ;
Try it.
measure =
IF (
MAX ( [Target Flag] ) = "Actual"
&& MAX ( [Date.FYear] ) = 2023,
SUM ( [X.var] ),
0
)
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Switch(sum(valuecolumn), 'Target Flag' = 'Actual' && 'Date.FYear' = '2023', "Required value",0)
More powerbi tips on www.youtube.com/perepavijay
Proud to be a Super User!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
40 | |
30 | |
27 | |
18 | |
17 |