The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello,
My database structured like this. I want to calculate YTD value for each month but on distinct values
ID | DATE_COD | STATUS |
ID1 | 20220101 | Active |
ID1 | 20220201 | Active |
ID1 | 20220301 | Active |
ID1 | 20220401 | Terminated |
ID2 | 20220101 | Active |
ID2 | 20220201 | Terminated |
20220101 - 2 unique items were active between start of the year till date
20220101 - 2 unique items were active between start of the year till date
20220301 - 2 unique items were active between start of the year till date
because doing it a normal way with datesytd I got 2 for Jan, 3 for Feb, 4 for March. But these are only two items and they were active!
Thank you in advance for your help
Solved! Go to Solution.
Hi,
You may download my PBI file from here.
Hope this helps.
Hi,
You may download my PBI file from here.
Hope this helps.
use DISTINCTCOUNT() instead of COUNT()
User | Count |
---|---|
69 | |
69 | |
66 | |
54 | |
28 |
User | Count |
---|---|
112 | |
82 | |
66 | |
48 | |
43 |