Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I have this measure that first filters out all rows from a date column that are older than a given date; and then counts the rows in 'Document Key' column.
Under1Year = COUNTX(FILTER('Inventory',[Content Current Date].[Date] >= CONVERT("03/01/2019",DATETIME)),'Inventory'[Document Key])
This was working fine.
Now, there's an additional requirement to count only unique values from that column. I modified the formula as below but none of them worked.
This one gave the same result as the above original formula(which I know is incorrect as there are duplicate values present in the 'Document Key' column after the date filter is applied)
Under1Year = COUNTX(FILTER('Inventory',[Content Current Date].[Date] >= CONVERT("03/01/2019",DATETIME)),DISTINCTCOUNT('Inventory'[Document Key]))
Then I tried this one and, as expected, it threw a runtime error as DSTINCTCOUNT only accepts a column as an argument.
Under1Year = DISTINCTCOUNT(COUNTX(FILTER('Inventory',[Content Current Date].[Date] >= CONVERT("03/01/2019",DATETIME)),'Inventory'[Document Key]))
Any suggestions on how to get this to work?
- Regards
Solved! Go to Solution.
Something like this maybe:
Mdis = CALCULATE(DISTINCTCOUNT(Inventory'[Document Key]), Inventory[[Content Current Date]] >= DATE(2020, 03, 01))
Something like this maybe:
Mdis = CALCULATE(DISTINCTCOUNT(Inventory'[Document Key]), Inventory[[Content Current Date]] >= DATE(2020, 03, 01))
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |