Forum Discussion
Count by Catagory
- 6 years ago
Hi ravitejaballa ,
Try this measure
TestMeasure =
var a = CALCULATE(MAX(deviceHours[timestamp]),ALLSELECTED())
var b = CALCULATE(DISTINCTCOUNTNOBLANK(deviceHours[DeviceID]),FILTER(deviceHours,deviceHours[timestamp] = a))
RETURN
b
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
Anonymous
Thank for reply,
I think we are close to solution.
You solution work for timestamp (7/11/2020) as we have data on this day for all devices.
But as you can see from below for timestamp - 7/13/2020.
It failed, because for binLegend it took max date but we need to get last availabe date in the given range.
Excepted output:
- Anonymous6 years agoNot applicable
Hi ravitejaballa ,
Incase you want the last Available Date, just remove ALLSELECTED()
Regards,
Harsh Nathani
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!
- ravitejaballa6 years ago
Helper III
Anonymous Tried that but failed.
- Anonymous6 years agoNot applicable
Hi ravitejaballa ,
Your filter context is BinLegend and you are looking for Last Date by Id ?
Do you want the last visible date by BinLegend or By ID ?
Not sure if the slicer will work on this. Need to check.
This gives me the MAX Date of the BIN Legend, but you need the dates by ID ?
Not sure but can I know the business insights which this will give . Just curious.
Regards,
Harsh Nathani
- ravitejaballa6 years ago
Helper III
Anonymous
I need how many number of deviceIDs falls into each binLegend.
For a given timestamp range, we need to get latest/last avaiable value (LatestHours/binLegendMeasure).
and
count number of deviceIDs in each binLegend