cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Change visual format when slicer selection changes

Hi,

 

I have a slicer containing 'lines' and 'percentage'. Dependent on the selection, I want the format of the table visual (see printscreen) to be adjusted to number when lines is selected or percentage when percentage is selected. How should I achieve this? The values or percentages in the table are a measure selection out of 'slicer_table'.

 

Table_measure_selection =
SWITCH( UPPER(SELECTEDVALUE(Slicer_table[Key])),
"YTD_OTAE",[YTD % On time or early],
"YTD_OTAE_lines",[YTD_inbound_lines_in_time_or_early],
"YTD_OT",[YTD % On time],
"YTD_OT_lines",[YTD_inbound_lines_in_time],
"YTD_E",[YTD % Early],
"YTD_E_lines",[YTD_inbound_lines_early],
"YTD_L",[YTD % Late],
"YTD_L_lines",[YTD_inbound_lines_late],
"MTD_OTAE",[MTD % On time or early],
"MTD_OTAE_lines",[MTD_inbound_lines_in_time_or_early],
"MTD_OT",[MTD % On time],
"MTD_OT_lines",[MTD_inbound_lines_in_time],
"MTD_E",[MTD % Early],
"MTD_E_lines",[MTD_inbound_lines_early],
"MTD_L",[MTD % Late],
"MTD_L_lines",[MTD_inbound_lines_late],
"RT_OTAE",[RT % On time and early],
"RT_OTAE_lines",[Running_total_on_time_and_early],
"RT_OT",[RT % On time],
"RT_OT_lines",[Running_total_on_time],
"RT_E",[RT % Early],
"RT_E_lines",[Running_total_early],
"RT_L",[RT % Late],
"RT_L_lines",[Running_total_late],
BLANK()
)

 

2019-12-09 14_27_08-OTD_Inbound_Rev2 (UC_OTD_Lines_Tab_Supplier_performance) - Power BI Desktop.png 

 

 

10 REPLIES 10
Super User
Super User

Re: Change visual format when slicer selection changes

@Hyperchef1969 Are you getting the correct measure with current switch condition? 






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Re: Change visual format when slicer selection changes

Yes, it is only presented in percentages when I switch to lines.

Super User
Super User

Re: Change visual format when slicer selection changes

@Hyperchef1969 ok but you are getting lines measure value although it is shown as %, correct?






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Re: Change visual format when slicer selection changes

Yes, that is correct!

Super User
Super User

Re: Change visual format when slicer selection changes

@Hyperchef1969 so you need to use format function to return text value and use format expression based on Line or % selection

 

Your measure = 
VAR __yourvalue = <existing switch function>
RETURN
IF ( SELECTEDVALUE (Table[Your line or % column] ) = "%",
FORMAT ( __yourvalue, "Percent" ),
FORMAT ( __yourvalue, "General Number" )
)

 






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Re: Change visual format when slicer selection changes

Hi,

 

For the table this helps perfectly, but I cannot select the new measure with the flexible format for a line graph. Do you know why? I need that also, so the line graph should also present percentages or lines.

 

Thanks for your help in advance.

Re: Change visual format when slicer selection changes

Also the table format is text and not number I believe. I have to sort on totals when the table is showing lines and this is not working oke. 

2019-12-10 08_25_05-Window.png

Super User
Super User

Re: Change visual format when slicer selection changes

@Hyperchef1969 with format your data is converted into text and thats why you cannot use it in line graph, to achieve this, you need to create bookmarks to show % and value line graph, you cannot achieve this with one measure.






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Re: Change visual format when slicer selection changes

Thanks for the info. Can you help me ahead with achieving this with bookmarks?

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)