Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
| 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.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 8 | |
| 5 | |
| 5 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 18 | |
| 10 | |
| 9 | |
| 7 | |
| 7 |