Forum Discussion
Dynamic distinct counts by group by considering only latest records
- 5 years ago
rammishra , This will not help in the case of the calculated column.
Both score and rank category need to be measure.
Then you need an independent table to have values of the rank category ("Low", "Medium", "High") , join the column of this table with your rank category measure in a new measure with a group by FacilityID
measure like, M2 , you have to use
M1= sumx(values(Table[FacilityID]),[score])
M2= calculate([M1], filter(Table, [rank category] = max(category[category]))
refer my blog/ video for more detailed steps
Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1387187#M626
Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k
#PowerBI5 #DynamicSegmentation #Bucketing #Binning #powerbiturns5 #kanerika #bu
Hi,
Please refer to the solution provided by Amit in the thread. The calculation of Measures should provide you the solution. If you are stuck, please share more details to understand it better. An alternate solution could also be achieved by using calculated columns (define a boolean column to check whether the record is 'latest' based on your criteria and then use this column to visualize only latest values on the chart).
Unfortunately, I don't understand this solution at all 😞
Hi, I am trying to produce something similar but this is not working for me at all . I am told index is not a function?
I have an updates table that update a user status from approved, not approved in categories one and category 2. I also have a calendar table
e.g.
| User name | Category 1 | Category 2 | Created on |
| user 2 | approved | not approved | 5/1/23 |
| user 1 | approved | not approved | 3/1/23 |
| user 2 | approved | approved | 2/1/23 |
| user 1 | not approved | Approved | 1/1/23 |
| user 3 | not approved | approved | 2/1/23 |
I would like to be able to display a bar chart with a date slider that can show for example the countof category one approved users on a chosen day...so if I filter to 4/1/23 then the count for category 1 approved user would be 2 (users 1and 2) and the count for category 1 not approved would be 1 (user3), count category 2 approved 2 (users 2 and 3), category 2 not approved 1 (user1) as it would only take into account the latest record for a user not the ones previously. So data table filtered to 4/1/23 as below
| UserName | Category 1 | category 2 | latest Created on |
| user 2 | approved | approved | 2/1/23 |
| user 1 | approved | not approved | 3/1/23 |
| user 3 | not approved | approved | 2/1/23 |
and bar chart as
So far I have this measure w