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 )
Greg_Deckler
1 year agoCommunity Champion
srlabhe This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149
The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.
srlabhe
1 year agoSuper User
Hmm,
is there any way we check if MO=CO then take Days CO and print it on all rows of the Eid?