Forum Discussion
Calculate max date value from date range
- Anonymous4 years ago
Hi mabdelrahman76 ,
If you dont want to have constant value for Status , just remove the filter in measure, like:
Measure = var _max=CALCULATE(MAX('Table'[Modified]),FILTER(ALLSELECTED('Table'),[CD_Trading_Id]=MAX('Table'[CD_Trading_Id]))) return IF(MAX('Table'[Modified])=_max,1,0)It will work, please try.
Best Regards,
Eyelyn Qin
Hi mabdelrahman76 ,
You could refer to this blog about How to provide sample data in the Power BI Forum
I have built some dummy data to test, please try to create a flag measure and then apply it to filter pane.
Measure =
var _max=CALCULATE(MAX('Table'[Modified]),FILTER(ALLSELECTED('Table'),[CD_Trading_Id]=MAX('Table'[CD_Trading_Id]) && [Status]="Closed Cases"))
return IF(MAX('Table'[Modified])=_max,1,0)
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous , thanks for the feedback, but i dont want to have constant value for Status column, also i would likw to achive to return one value per group column "CD_Trading_id" based on the last modified date of the date range selection. i modified the data as what is shows in the below screeshoot to have good example.
my goal is to be able to return the maxiumum the values based on the max modified date range for each group in the date range selection, in my example if no selection i will return the below values based on the max date for each group.