Forum Discussion
srlabhe
1 year agoSuper User
Finding Max Days per row
Hi PBI Gurus I have below data Where Days CO is a measure calculated based on selected date in slicer like below = var _maxDate=[MaxAsOfDateSelected] var _diff= NETWORKDAYS(SELECTEDV...
- 1 year ago
Hi srlabhe
Try this:
CO with top days = CALCULATE ( -- Get the CO with the highest [Days CO] in the current filter context MAXX ( TOPN ( 1, -- Create a table of COs with their corresponding [Days CO] values SUMMARIZECOLUMNS ( 'Table'[CO], "@value", [Days CO] ), [@value], DESC -- Sort descending by [Days CO] and take top 1 ), [CO] -- Return the CO name (could also use [@value] to return the max value) ), ALLSELECTED () -- Respect slicers and visuals while removing row context )
srlabhe
1 year agoSuper User
While calculating Days MO it gives me below error
The MAX function only accepts a column reference as the argument number 1.
Greg_Deckler
1 year agoCommunity Champion
srlabhe Correct, since it is a measure, you have to do it via measure aggregation as I mentioned.
- srlabhe1 year agoSuper User
So it should be in my case
Days MO=maxx(summarize(Table,Eid,"Measure", [Days CO]),[Days CO])
- Ashish_Mathur1 year agoSuper User
Hi,
Share the download link of the PBI file.