Forum Discussion
include extra column - target
- 1 year ago
Hello jps_HHH
try this solution
Custom Column =
UNION(
SELECTCOLUMNS('DateTable', "Month", FORMAT('DateTable'[Date], "MMM YYYY")),
DATATABLE("Month", STRING, {{"Target"}})
)
Update your value measure like this
Final Value =
VAR SelectedKPI = SELECTEDVALUE('Measures Table'[Key Performance Indicator])
VAR CurrentCol = SELECTEDVALUE('Month_Column_Table'[Month])
RETURN
SWITCH(
TRUE(),
CurrentCol = "Target",
SWITCH(
SelectedKPI,
"year Sales", [year Sales Target],
"Training", [Training Target],
"Quality", [Quality Target]
),
-- Else return monthly values
SWITCH(
SelectedKPI,
"year Sales", CALCULATE([year Sales], 'DateTable'[MonthYear] = CurrentCol),
"Training", CALCULATE([Training], 'DateTable'[MonthYear] = CurrentCol),
"Quality", CALCULATE([Quality - Issues/Batch], 'DateTable'[MonthYear] = CurrentCol)
)
)
Thanks,
Pankaj Namekar | LinkedInIf this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
Hello jps_HHH
try this solution
Custom Column =
UNION(
SELECTCOLUMNS('DateTable', "Month", FORMAT('DateTable'[Date], "MMM YYYY")),
DATATABLE("Month", STRING, {{"Target"}})
)
Update your value measure like this
Final Value =
VAR SelectedKPI = SELECTEDVALUE('Measures Table'[Key Performance Indicator])
VAR CurrentCol = SELECTEDVALUE('Month_Column_Table'[Month])
RETURN
SWITCH(
TRUE(),
CurrentCol = "Target",
SWITCH(
SelectedKPI,
"year Sales", [year Sales Target],
"Training", [Training Target],
"Quality", [Quality Target]
),
-- Else return monthly values
SWITCH(
SelectedKPI,
"year Sales", CALCULATE([year Sales], 'DateTable'[MonthYear] = CurrentCol),
"Training", CALCULATE([Training], 'DateTable'[MonthYear] = CurrentCol),
"Quality", CALCULATE([Quality - Issues/Batch], 'DateTable'[MonthYear] = CurrentCol)
)
)
Thanks,
Pankaj Namekar | LinkedIn
If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.