- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DAX measure issue with Distinct Row Count.
Objective: Create a DAX measure which gives me a unique row count based on 'Product' column. The condition is based on users, usage and month column.
Problem: For condition, Users = 0 and Usage = 0, the result of my row count is 2 because my DAX seems to calculate count of Product A + Product B. The expected value should be 1.
Expected Result: I want my DAX to give me a distinct/unique count of Products if all USERS & USAGE & All MONTHS for each product is equal to 0. The expected count value should be 1 (Product B) based on my sample data below.
I have Table A with the following columns and values:
Product | Month | Users | Usage
A | 1/1/2022 | 0 | 0
A | 2/1/2022 | 1 | 1
A | 3/1/2022 | 1 | 1
B | 1/1/2022 | 0 | 0
B | 2/1/2022 | 0 | 0
B | 3/1/2022 | 0 | 0
C | 1/1/2022 | 1 | 1
C | 2/1/2022 | 1 | 1
C | 3/1/2022 | 1 | 1
Here's my current DAX Measure that is not giving me the required result count:
Unused Products =
CALCULATE
(DISTINCTCOUNT('TableA'[Products]),
'TableA'[Users] == 0 && 'TableA'[Usage] == 0
) + 0
Can you please help me fix my DAX? I appreciate all your help in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Zero Usage Products =
var a = SUMMARIZE('TableA',[Product],"r",COUNTROWS('TableA'),"z",CALCULATE(COUNTROWS('TableA'),'TableA'[Usage]=0,'TableA'[Users]=0))
return COUNTROWS(filter(a,[r]=[z]))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Zero Usage Products =
var a = SUMMARIZE('TableA',[Product],"r",COUNTROWS('TableA'),"z",CALCULATE(COUNTROWS('TableA'),'TableA'[Usage]=0,'TableA'[Users]=0))
return COUNTROWS(filter(a,[r]=[z]))

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
07-21-2024 09:43 PM | |||
06-22-2023 05:25 AM | |||
Anonymous
| 12-06-2023 08:17 AM | ||
Anonymous
| 01-08-2024 01:34 PM | ||
06-26-2023 05:24 AM |
User | Count |
---|---|
42 | |
33 | |
29 | |
26 | |
26 |
User | Count |
---|---|
37 | |
26 | |
21 | |
21 | |
17 |