Forum Discussion
DAX FORMAT value based on slicer selection
- 4 years ago
Hi, Anonymous ;
Maybe you can optimize the code a little bit as follows, but I've tested your code and it works. Maybe your data itself or all three measures check to see if they can all return numeric values. You can follow my simple example:
MeasureSelection = SWITCH(VALUES('Measures Table'[Measure]), "Net Sales/Lb", FORMAT('Sales & Volume Data'[NS per Lb.],"$0.00;($0.00);0 "), "Volume", FORMAT('Sales & Volume Data'[Volume],"0.00;(0.00);0"), "Mix", FORMAT('Sales & Volume Data'[Percent], "0.00%;(0.00%);0"), BLANK())The final output is shown below:
There is another possibility that three measures are applied to the matrix, which shows blank space due to row level reasons. Could you check it? If it is not solved, can you share simple files or screenshots to remove sensitive information?
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You can now use Field Parameters for that, and swap out the measure as needed.
Hi lbendlin thank you for the quick reply
My requirement is to show workload performed at each facility (%/hr or min/hr) based on shifts (Day, Night,Weekends and Total). I have already created one Field Parameters with 4 measures to get the workload based on shifts and using that slicer in my chart to swap the measures.
Can you help me how can I map another Field parameters (with 2 new measures) that swap between %/hr and min/hr which acts as an independent slicer from the Shifts slicer
below is screenshot for your reference of what our desired output is
Thanks,
-Dileep
- lbendlin3 years agoSuper User
Change the field parameter to include all 8 combinations, or use separate visuals.