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 there,
I have the following dataset...
Sample APR is a calculated column which contains randomly generated numbers.
APR Group groups these. So basically 5.X = 5, 6.X = 6, etc etc.
I want to create a third calculated columns which counts the number of distinct values in the Sample APR column, desired output like the following....
I naturally tried to use DISTINCTCOUNT, with the following DAX:
Test = CALCULATE(DISTINCTCOUNT(Table1[Sample APR]),ALL(Table1), Table1[APR Group] = EARLIER(Table1[APR Group]))
Thanks @tex628
That appears to be grouping the APR Group column rather than the Sample APR one though. Been trying variations of your solution but still no luck unfortunately.
My apologies, i didnt read the initial post well enough!
Column = CALCULATE(COUNTROWS(Table1) , ALL(Table1) , Table1[Sample APR] = EARLIER(Table1[Sample APR]) , Table1[APR Group] = EARLIER(Table1[APR Group]))
Hope it works!
User | Count |
---|---|
76 | |
75 | |
46 | |
31 | |
28 |
User | Count |
---|---|
99 | |
91 | |
51 | |
49 | |
46 |