Forum Discussion
Dynamic DAX
Hi Anonymous
You add the “KP1” measure to a visual, then when selecting among measure name (eg. 01. # Material units) this visual will show the value calculated by “KPI_MAT_NBR_ENGINE1” measure, right?
“this old statement only works for 1kpi selected”
“We would display up to 5 KPI's in one Chart”
Actually, I can’t make myself clear about what’s you are looking for.
I find a pbix similar to your description, is this relevant to your situation?
Best Regards
Maggie
- Anonymous8 years agoNot applicable
I have it working, 5 selected KPI's (measures) on a chart.
But the main goal would be to create the switch dynamic.
Now we have all our KPI's listed (fortunalty they come from a database and a script generates to switch, just copy paste).
But it would be great to have something like in excel INDIRECT
So instead of (this is a reduced one, our biggest has 160 lines)
KPI_2_P:= SWITCH(TRUE(), [KPI_2_P_CODE] = "KPI_MAT_KM_Pct_PAV_TOTAL", [KPI_MAT_KM_Pct_PAV_TOTAL], [KPI_2_P_CODE] = "KPI_MAT_DUR_Pct_PAV_COMMPAV", [KPI_MAT_DUR_Pct_PAV_COMMPAV], [KPI_2_P_CODE] = "KPI_MAT_KM_Pct_PAV_MAT", [KPI_MAT_KM_Pct_PAV_MAT] )to have something like
KPI_2_P:= IF(ISBLANK([KPI_2_P_CODE]),BLANK(), INDIRECT([KPI_2_P_CODE]))
Where the INDIRECT users the text in KPI_2_P_CODE and fetches/executes the DAX composed in that, in our case the measure.