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! Learn more
| Reservation_Id | Category | Product |
| 1 | ||
| 1 | ||
| 2 | A | Fish |
| 2 | B | Chips |
| 2 | C | Fanta |
| 3 | A | Fish |
| 3 | A | Fish |
| 4 | ||
| 4 | A | Fish |
Solved! Go to Solution.
Hi @Anonymous ,
Please use the following measure:
countblank category = COUNTBLANK('Table'[Category])
countcategorywithnoblank = COUNTX(FILTER('Table','Table'[Category]<>BLANK()),'Table'[Category])
distinctcountcategory = CALCULATE(DISTINCTCOUNT('Table'[Category]),FILTER(VALUES('Table'[Category]),'Table'[Category]<>BLANK()))
Measure1 = VAR COUNTCA = [distinctcountcategory] return CALCULATE(DISTINCTCOUNT('Table'[Reservation_Id]),FILTER(VALUES('Table'[Reservation_Id]),[countcategorywithnoblank] = COUNTCA &&[distinctcountcategory] = COUNTCA))
Measure2 = CALCULATE(DISTINCTCOUNT('Table'[Reservation_Id]),FILTER(VALUES('Table'[Reservation_Id]),[countcategorywithnoblank] = 0))
Measure3 = VAR COUNTCA = [distinctcountcategory] return CALCULATE(DISTINCTCOUNT('Table'[Reservation_Id]),FILTER(VALUES('Table'[Reservation_Id]),[countcategorywithnoblank] < COUNTCA &&[countcategorywithnoblank]>0 &&[countblank category]>0))
Measure4 = CALCULATE(DISTINCTCOUNT('Table'[Reservation_Id]),FILTER(VALUES('Table'[Reservation_Id]),[countcategorywithnoblank]>[distinctcountcategory]))
Please also refer to the pbix file.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
Hi @Anonymous ,
Please use the following measure:
countblank category = COUNTBLANK('Table'[Category])
countcategorywithnoblank = COUNTX(FILTER('Table','Table'[Category]<>BLANK()),'Table'[Category])
distinctcountcategory = CALCULATE(DISTINCTCOUNT('Table'[Category]),FILTER(VALUES('Table'[Category]),'Table'[Category]<>BLANK()))
Measure1 = VAR COUNTCA = [distinctcountcategory] return CALCULATE(DISTINCTCOUNT('Table'[Reservation_Id]),FILTER(VALUES('Table'[Reservation_Id]),[countcategorywithnoblank] = COUNTCA &&[distinctcountcategory] = COUNTCA))
Measure2 = CALCULATE(DISTINCTCOUNT('Table'[Reservation_Id]),FILTER(VALUES('Table'[Reservation_Id]),[countcategorywithnoblank] = 0))
Measure3 = VAR COUNTCA = [distinctcountcategory] return CALCULATE(DISTINCTCOUNT('Table'[Reservation_Id]),FILTER(VALUES('Table'[Reservation_Id]),[countcategorywithnoblank] < COUNTCA &&[countcategorywithnoblank]>0 &&[countblank category]>0))
Measure4 = CALCULATE(DISTINCTCOUNT('Table'[Reservation_Id]),FILTER(VALUES('Table'[Reservation_Id]),[countcategorywithnoblank]>[distinctcountcategory]))
Please also refer to the pbix file.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
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.