Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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]
)
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]
)
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)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 6 | |
| 5 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 11 | |
| 9 | |
| 9 | |
| 8 |