Forum Discussion
Buttons that change data labels
- 5 years ago
Anonymous If you want them to be able to choose, you'll need to get a little fancy with measures AND bookmark or parameter slicer. If you want to display both, you only need measures.
Create new measures:
Absolute Value = COUNT(Table[SalesDocuments])
Percent = DIVIDE([Absolute Value], CALCULATE([Absolute Value], ALL(Table[Division]))
Create a new table visual, with both measures in it and Division.
Now for the fancy part:
Option A: Slicer
Click 'Enter Data'
Paste this table:
Show Value As Absolute Percent Put Slicer[Show Value As] column in a slicer visual.
Create a new measure:
Value = SWITCH(SELECTEDVALUE(Slicer[Show Value As]), "Absolute", [Absolute Value], "Percent", FORMAT([Percent], "#.00%"), [Absolute Value])Put the [Value] measure in your table and test the slicer.
Option B: Bookmarks
Duplicate the table. Remove [Percentage] from one table and remove [Absolute Value] from the other table. Hide the Percentage table, create a new bookmark, name it 'Absolute Value'. Click the three dots and untick 'data' and 'current page'. Now unhide percentage table and hide absolute value table. Repeat bookmark creation process, but name it 'Percentage'.
Add a button for each bookmark.
Anonymous Yay! Glad it's working, kudos for getting it done!
For the pie chart, I'm not sure why you have all three measures displayed in the pie chart? The 0% Will be the 'SalesDocPercent' field, since it's a percent, the numbers are much smaller so they are displaying as zero percent of total just because they are so small. Pick one measure only for the pie chart, then make sure you have that measure formatted properly (as a percent if you want the SalesDocPercent value to display as percent).
Not sure if that's what you're asking or if it makes sense?
Yeah I know what you mean... unfortunately thats not what my colleagues require me to do...:/ I guess I'll just have to try it with bookmarks then and see if I can configure them as I want (apply slicer, interactive measures etc...)