Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have data table similar to following one
then using measures in power bi I got the matrix as following
I want to give marks to branches using measure, considering Grade and Measure values
similar to this
=IF(Branch="A",IF(Measure1>0.25,0,IF(Measure2>0.2,5,IF(Measure1>0.15,10,IF(Measure1>0.1,20,30)))),IF(Branch="B",IF(Measure1>0.2,0,IF(Measure1>0.15,5,IF(Measure1>0.1,10,IF(Measure1>0.07,20,30)))),IF(Measure1>0.15,0,IF(Measure1>0.1,5,IF(Measure1>0.07,10,IF(Measure1>0.05,20,30))))))+IF((Measure1-Measure2)>0,-(ROUND((Measure1-Measure2)/0.005,0)),0)
I can do this in excel but how can I do this in Power BI?
Instead of IF use SWITCH. Your Measure1 and Measure2 are SUM( Table[value 1] ) and SUM( Table[value 2] ), respectively. Tha branch must be retrieved from the current filter context via SELECTEDVALUE. ROUND is just... ROUND.
Please use the links above to familiarize yourself with how the functions work. You'll also find examples of usage on the pages.
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
6 |