Forum Discussion
Pk8524
Helper I
1 year agoData label only for Max Value with Time Aggregation parameter
Hi Guys, How to show only one data label with Max value for certain Time aggregation parameter? I am using following parameter: Time Aggregation = {
("Year", NAMEOF('dimCale...
- 1 year ago
You can create a new measure
Total Sales Data Label = VAR CurrentValue = [Total Sales] VAR MaxValue = SWITCH( SELECTEDVALUE( 'Time Aggregation'[Time Aggregation Order] ), 0, -- Year MAXX( ALLSELECTED( dimCalendar[Year] ), [Total Sales] ), 1, -- Quarter MAXX( ALLSELECTED( dimCalendar[Quarter] ), CALCULATE( [Total Sales], REMOVEFILTERS( dimCalendar[QuarterNr] ) ) ), 2, -- Month MAXX( ALLSELECTED( dimCalendar[Month] ), CALCULATE( [Total Sales], REMOVEFILTERS( dimCalendar[MonthNr] ) ) ) ) VAR Result = IF( CurrentValue = MaxValue, CurrentValue ) RETURN Resultand use that as the value for the data labels on the chart visual.
johnt75
Super User
1 year agoYou can create a new measure
Total Sales Data Label =
VAR CurrentValue = [Total Sales]
VAR MaxValue = SWITCH(
SELECTEDVALUE( 'Time Aggregation'[Time Aggregation Order] ),
0, -- Year
MAXX(
ALLSELECTED( dimCalendar[Year] ),
[Total Sales]
),
1, -- Quarter
MAXX(
ALLSELECTED( dimCalendar[Quarter] ),
CALCULATE( [Total Sales], REMOVEFILTERS( dimCalendar[QuarterNr] ) )
),
2, -- Month
MAXX(
ALLSELECTED( dimCalendar[Month] ),
CALCULATE( [Total Sales], REMOVEFILTERS( dimCalendar[MonthNr] ) )
)
)
VAR Result = IF( CurrentValue = MaxValue, CurrentValue )
RETURN Result
and use that as the value for the data labels on the chart visual.
Pk8524
Helper I
1 year agowhy it is needed to remove filters on quarter nr?
MAXX(
ALLSELECTED( dimCalendar[Quarter] ),
CALCULATE( [Total Sales], REMOVEFILTERS( dimCalendar[QuarterNr] ) )
),