Forum Discussion
Measure as filter
- 8 years ago
Anonymous, I don't think this is possible by using a Switch function. Switch will always return 1 measure.
I would suggest you try the following:
Step 1: Add all 3 measures in your bar chart. Make sure that your measure uses both "Calculate" and "Filter" function
e.g. CALCULATE(SUM(VALUES),FILTER(TABLE, TABLE[ACCOUNT] = "TOTAL SALES"
Step 2: Create a slicer for your accounts i.e. "Total Sales", "Total costs" and "Total Profit".
Now when you select nothing in the slicer, all the measures should be visible. If you select any one value, only that measure is shown.
Hope this help
Nishant
- Anonymous8 years ago
Create a Selection Table that contains 2 fields. A numeric ID column and a String Text column. Create a slicer that will display the values in your Selection Table. When any of these selections are chose, the context of Power BI will filter down to just that single row.
Now if you do a MIN('Selection Table'[ID]) you will know the value of your selection. If nothing is selected you will get the smallest value in your selection table, which you could make as "(Blank)"
From here, you could use that within a Switch statement to run different measures depending on the Values in you selection table. So 0 could equal "Error Message", 1 could be your first measure, 2 could be your second measure and so forth.
Anonymous,
I don't think you can achieve your requirement in this scenario. When you choose nothing in the slicer, only one measure or a single value can be shown.
Regards,
Lydia
- Anonymous8 years agoNot applicable
Create a Selection Table that contains 2 fields. A numeric ID column and a String Text column. Create a slicer that will display the values in your Selection Table. When any of these selections are chose, the context of Power BI will filter down to just that single row.
Now if you do a MIN('Selection Table'[ID]) you will know the value of your selection. If nothing is selected you will get the smallest value in your selection table, which you could make as "(Blank)"
From here, you could use that within a Switch statement to run different measures depending on the Values in you selection table. So 0 could equal "Error Message", 1 could be your first measure, 2 could be your second measure and so forth.