Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi
How to calculate count distinct values based on max date column. I need count of all distinct id whoes date is max
Solved! Go to Solution.
Hi, @Sameer5858
You can try the following methods.
Sample data:
Measure:
Count = Var _maxdate=CALCULATE(MAX('Table'[Date]),ALL('Table'))
Return
CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER(ALL('Table'),[Date]=_maxdate))
Is this the result you expect? If not, please provide some of the example data and desired results.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Sameer5858
You can try the following methods.
Sample data:
Measure:
Count = Var _maxdate=CALCULATE(MAX('Table'[Date]),ALL('Table'))
Return
CALCULATE(DISTINCTCOUNT('Table'[ID]),FILTER(ALL('Table'),[Date]=_maxdate))
Is this the result you expect? If not, please provide some of the example data and desired results.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I would do something like this
Var maxDate = Max('YourFactTable'[DateColumn])
var result = calculate( DISTINCTCOUNT('YourFactTable'[IDColumn]), 'YourFactTable'[DateColumn]=maxDate)
return result
If this post was helpful, please kudos or accept the answer as a solution.
~ Anthony Genovese
Need more PBI help? PM me for affordable, dedicated training or consultant recomendations!
User | Count |
---|---|
12 | |
12 | |
8 | |
8 | |
6 |
User | Count |
---|---|
27 | |
19 | |
13 | |
11 | |
7 |