This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi all ,
I'm trying to do a distinct count of locations based on their last status date.
the locations need to fufil 3 criteria, prefix, dept and changedate before the max slicer date selected
Eg: for July, both locations fufil all 3 criteria, so count should be 2
but for august, location 702 should be counted, but 701 should not be.
How can i use a measure to count rows based on max change date < max selected dates? Thanks
Solved! Go to Solution.
@ben-t , if date table is not joined
new measure =
var _date = MAXX(allselected('Date Table'), 'Date Table'[Date])
return
CALCULATE(distinctCOUNT(Locations[locations.location]),FILTER(Locations, Locations[locations.changedate]<= _max))
if joined with date on change date
new measure =
var _date = MAXX(allselected('Date Table'), 'Date Table'[Date])
return
CALCULATE(distinctCOUNT(Locations[locations.location]),FILTER(all(Date Table'), 'Date Table'[Date]<= _max))
Hi @ben-t
Have you solved your problem? If yes, could you kindly mark the answer helpful as the solution?
If not, could you provide more details about your problem? so that we can work on it further. Thanks.
Best Regards,
Community Support Team _ Tang
Hi @ben-t
I think your measure is right, for august, one row of location 701 fullfils 3 criteria, but another not. so the distinctCOUNT of location should be 2. (row2 & row3)
If I miss anything, please let me know. and could you share your sample file? so that we can check the measure further.
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Or is it possible to create a dax table where i can have distinct rows of each location, based on the max status date < max slicer date?
@ben-t , if date table is not joined
new measure =
var _date = MAXX(allselected('Date Table'), 'Date Table'[Date])
return
CALCULATE(distinctCOUNT(Locations[locations.location]),FILTER(Locations, Locations[locations.changedate]<= _max))
if joined with date on change date
new measure =
var _date = MAXX(allselected('Date Table'), 'Date Table'[Date])
return
CALCULATE(distinctCOUNT(Locations[locations.location]),FILTER(all(Date Table'), 'Date Table'[Date]<= _max))
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 26 | |
| 23 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 62 | |
| 47 | |
| 28 | |
| 24 | |
| 21 |