Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
51 | |
27 | |
24 | |
13 | |
8 |
User | Count |
---|---|
74 | |
52 | |
47 | |
16 | |
12 |