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 )
danextian
1 year agoSuper User
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
)
- srlabhe1 year agoSuper User
Sorry but when I go to summary level it shows me sum of all and not Eid level data ....
- srlabhe1 year agoSuper User
Days with MO shows as below if not filtered for ant Eid
- srlabhe1 year agoSuper User
Its not working as expected
- srlabhe1 year agoSuper User
Allselected() -- Respect slicers and visuals while removing row context
Seems this is the issue , I want the Max of Days CO to refletc for each Eid even if the visual is not filtered