Forum Discussion
Power Bi -> Max_value and Count
- 1 year ago
Hi Molika,
I understand your requirement.
Please find the updated DAX measure below:DateCountPerID_Filtered =
CALCULATE(
COUNTROWS('Table'),
FILTER(
'Table',
'Table'[ID] = MAX('Table'[ID])
)
)
Please refer below attached snaps for your reference.
I hope my suggestions provided valuable insights. If you have any further questions, don’t hesitate to ask in a follow-up message.
If this post helped, please mark it as "Accept as Solution" so others can benefit as well.Best regards,
Sahasra.
Hi Molika - Create These Two Measures as follows:
Min_Date_Filtered = MIN('YourTable'[Date])
Max_Date_Filtered = MAX('YourTable'[Date])
You want to count how many times each id appears in the filtered table
Count_Dates_Per_ID =
CALCULATE(
COUNTROWS('YourTable'),
ALLEXCEPT('YourTable', 'YourTable'[id])
)
It respect the slicer (filtered Date column)
Return 1 for ID 134 and 141
Return 2 for ID 164 (as it appears with two different dates)
Hope this helps, pelase check.
Hi, thanks for your response.
for ID 164 it counts 3 because it also appearse in the data with date 26.01.2025. although this date is not selected in the filter. As long as i have the columns 'date' in my view MIN / MAX just works for each row. when deleting the Column it works, but i need it within the View 😕