Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
hello,
I'm trying to create a measure which should retun the max of a value in the selected time period and also return the corresponding date on which that max value appeared.
Below is the screenshot of the sample data and highlighted row is the outcome I expect as separate measures.
The time period selected is Jan 2019. I was able to create a measure to return the max of value but not able to get the corresponding date. Please help! Thank you!
Solved! Go to Solution.
Assuming you have a date table, you can do the following:
Max = max (Table1[Value] )
Date of Max = Var __SelectedMax = CALCULATE( MAX( Table1[Value]), ALLSELECTED(DimDate) ) RETURN CALCULATE( VALUES(DimDate[Date]), FILTER( ALL( DimDate), [Max] = __SelectedMax ) )
and if you are so inclined you can put it all together for a card:
Measure for a Card = "Max of "&[Max]&" Occured on "& [Date of Max]
Thanks a lot for the solution. It served my purpose as well.
Try this calculated measure:
Assuming you have a date table, you can do the following:
Max = max (Table1[Value] )
Date of Max = Var __SelectedMax = CALCULATE( MAX( Table1[Value]), ALLSELECTED(DimDate) ) RETURN CALCULATE( VALUES(DimDate[Date]), FILTER( ALL( DimDate), [Max] = __SelectedMax ) )
and if you are so inclined you can put it all together for a card:
Measure for a Card = "Max of "&[Max]&" Occured on "& [Date of Max]
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |