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
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))
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 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 8 | |
| 7 |