Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
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!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
10 | |
10 | |
8 | |
7 |