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.
Hello,
So I got some issue on applying my measure on higher levelv of category.
Here's my data set:
Group | ID | X | Y | Z | Have X Y Z |
A | A01 | 10000 | 10000 | 10000 | 1 |
A | A02 | 10000 | 10000 | 10000 | 1 |
A | A03 | 0 | 10000 | 0 | 0 |
A | A04 | 0 | 10000 | 0 | 0 |
A | A05 | 0 | 10000 | 0 | 0 |
A | A06 | 10000 | 10000 | 10000 | 1 |
A | A07 | 10000 | 10000 | 0 | 0 |
A | A08 | 10000 | 10000 | 10000 | 1 |
B | A09 | 10000 | 0 | 0 | 0 |
B | A10 | 10000 | 0 | 10000 | 0 |
B | A11 | 0 | 0 | 10000 | 0 |
B | A12 | 0 | 0 | 10000 | 0 |
B | A13 | 0 | 0 | 10000 | 0 |
B | A14 | 0 | 10000 | 10000 | 0 |
B | A15 | 0 | 10000 | 10000 | 0 |
B | A16 | 10000 | 10000 | 10000 | 1 |
B | A17 | 10000 | 10000 | 0 | 0 |
B | A18 | 10000 | 0 | 0 | 0 |
C | A19 | 10000 | 0 | 0 | 0 |
C | A20 | 10000 | 0 | 0 | 0 |
C | A21 | 10000 | 0 | 0 | 0 |
C | A22 | 10000 | 0 | 0 | 0 |
C | A23 | 0 | 10000 | 0 | 0 |
C | A24 | 0 | 10000 | 10000 | 0 |
C | A25 | 10000 | 10000 | 10000 | 1 |
C | A26 | 10000 | 10000 | 10000 | 1 |
C | A27 | 10000 | 10000 | 10000 | 1 |
C | A28 | 10000 | 10000 | 10000 | 1 |
On Excel we can use if and countif statement to determine the have XYZ parameter
Desisred Output | |
A | 4 |
B | 1 |
C | 4 |
But on DAX, I Got
Row Labels | Sum of Have X Y Z |
A | 1 |
B | 1 |
C | 1 |
Grand Total | 1 |
Here's my DAX Calculation
Solved! Go to Solution.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
Desired outcome measure: =
SUMX (
ADDCOLUMNS (
DISTINCT ( 'Group'[ID] ),
"@condition",
IF (
COUNTROWS (
CALCULATETABLE (
FILTER ( 'Value', 'Value'[Sales] <> 0 ),
'Time'[Month] = "Nov"
)
) = 3,
1
)
),
[@condition]
)
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.
Hi,
I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.
Desired outcome measure: =
SUMX (
ADDCOLUMNS (
DISTINCT ( 'Group'[ID] ),
"@condition",
IF (
COUNTROWS (
CALCULATETABLE (
FILTER ( 'Value', 'Value'[Sales] <> 0 ),
'Time'[Month] = "Nov"
)
) = 3,
1
)
),
[@condition]
)
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.
Thank you for the inspiration. hope this also can help others.
the group itself is on seperate table, [Sales] is column. the DAX only for "Have XYZ" Calculation. after that I drag group to the row and the Have XYZ measure to the value section.
its challenging for me to create logic of ID that buy specific products (in this case X Y Z). and then applies it of group level because the IF statement on my measure also applied on region level (i expect only applied on id level and sum it on region level)
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 |
---|---|
47 | |
24 | |
20 | |
15 | |
12 |
User | Count |
---|---|
55 | |
48 | |
43 | |
19 | |
19 |