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.
Hi All,
Right now I create a table like below. Those fields are in the Table already. I would like to change the value when Table[Cat] = A and Table[Sub-Cat] = CC to Table[Sub-Cat] = BB. Is it possible to acheive it by just by using DAX formalar (Measure)?
Before
Cat | Sub-Cat | sum(Volume) |
A | AA | 0 |
A | BB | 1 |
A | CC | 2 |
B | AA | 3 |
B | BB | 4 |
B | CC | 5 |
C | AA | 6 |
C | BB | 7 |
C | CC | 8 |
After
Cat | Sub-Cat | sum(Volume) |
A | AA | 0 |
A | BB | 3 |
B | AA | 3 |
B | BB | 4 |
B | CC | 5 |
C | AA | 6 |
C | BB | 7 |
C | CC | 8 |
Volume Total by the condition : =
SWITCH (
TRUE (),
SELECTEDVALUE ( Categories[Cat] ) = "A"
&& SELECTEDVALUE ( Sub_Categories[Sub-Cat] ) = "CC", BLANK (),
SELECTEDVALUE ( Categories[Cat] ) = "A"
&& SELECTEDVALUE ( Sub_Categories[Sub-Cat] ) = "BB",
CALCULATE (
SUM ( Data[sum(Volume)] ),
Categories[Cat] = "A",
Sub_Categories[Sub-Cat] = "BB"
|| Sub_Categories[Sub-Cat] = "CC"
),
SUM ( Data[sum(Volume)] )
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
@KH_Mike , I DAX you have to create a new column
Sub Cat New =
if([Cat]= "A" && [Sub Cat] ="CC", "BB", [Sub Cat])
Is it possible to do it in "Measure" instead of adding new column / create new table behind? Thank you.
Hi,
Please try the below measure.
The columns that are refered in the measure are from the same table.
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
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 |
---|---|
107 | |
94 | |
77 | |
63 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |