Quantcast
Channel: Service topics
Viewing all articles
Browse latest Browse all 61836

DAX measure issue with Distinct Row Count.

$
0
0

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 DAX Measure:
Unused Products =
CALCULATE
(DISTINCTCOUNT('TableA'[Products]),
'TableA'[External]= "Yes", ///I am filtering all values in this column if there is a 'Yes'
'TableA'[Users] == 0 && 'TableA'[Usage] == 0
) + 0

 

Can you please help me fix my DAX? I appreciate all your help in advance. 


Viewing all articles
Browse latest Browse all 61836

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>