Forum Discussion
How to use the CASE statement in Power BI?
- Anonymous8 years ago
HI BBIUser,
I've created a sample data and used custom column to use -IF-ELSE-IF statements to get the result you need as shown below in images.
--------------------------------------------------------------
---------------------------------------------------------
Let me know if any doubt persists.
Thanks and Regards,
Piyush
Yes, SWITCH funtion is your equivalent or nested IF statements. Give me some sample data to play with and can be more specific. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Greg_Deckler My apologizes if my question was not clear and for not posting the sample data.
Here is the sample data.
Here cCount is "Current Year",
pCount is "Prior Year",
p1Count is "Current Year-2",
p2Count is "CurrentYear-3"
ThreeYrAvg is "3 Year Avg"
With the CASE statement I want to add another calculated column and a measure. Please let me know if it is more clear with the sample data. Thanks for your help!