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.
Code | Name | ||
PM 750 MG | A | measure1 | 20 |
CD-6"ASX | B | measure2 | 40 |
500-182-30 | C | measure3 | 35 |
CD-12"CP | D | ||
2046S | B | ||
103-137 | D | ||
530-123 | C | ||
CD-30DC | E | ||
CD-30DC | A | ||
CD-30DC | F | ||
CD-30DC | F | ||
CD-30DC | E | ||
CD-20APX | A | ||
CD-20APX | G | ||
CD-20APX | C | ||
CD-20APX | G | ||
192-630-10 | C |
I want to write a Dax measure to calculate (measure1 /2) if name =A or B, (measure2 /5) if name =C or D or E,(measure3 /7) if name =F or G
Thanks,,,,
Solved! Go to Solution.
1) Create a measure that changes with the selection in the filter. Ex. measure4 = values(name)
2.1) create another measure using switch statement. measure5 = switch(measure4, "A", [measure 1]/2, "B", [measure 1]/2, .......).
OR
It can also be done with IF statement.
2.2) It can also be done with IF statement.
1) Create a measure that changes with the selection in the filter. Ex. measure4 = values(name)
2.1) create another measure using switch statement. measure5 = switch(measure4, "A", [measure 1]/2, "B", [measure 1]/2, .......).
OR
It can also be done with IF statement.
2.2) It can also be done with IF statement.
I mean measure1/2 it divide measure1 / 2
Divide the measures OR divide measure1 by measure2
Also the previous response has been edited, see if that works.
User | Count |
---|---|
25 | |
12 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
10 | |
6 |