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

Dynamically Change Format In Visual

I'm confused on how to use best practices with a slicer.   I want the users to essentially be able to choose Units or Sales in a slicer where Key is selected for Slicer.   This would then flow thru to a visual that would be a bar chart with a yoy line.   I can create the yoy measure for both, so thats not the issue.   However, the problem I'm having is that sales is in dollars and units is not.  I have my data structured like this:

 

CompanyDateKeyValue
Company ANov-19Sales$12.50
Company ADec-19Sales$15.50
Company ANov-19Units2
Company ADec-19Units4
Company BNov-19Sales$20.50
Company BDec-19Sales$25.00
Company BNov-19Units4
Company BDec-19Units5

 

Is it really not possible to dynamically change the format in a visual?  

 

Has this been solved? 

https://community.powerbi.com/t5/Desktop/Dynamically-format-a-measure-as-or/td-p/157192

 

Thank you in advance

5 REPLIES 5
Highlighted
Super User VII
Super User VII

Re: Dynamically Change Format In Visual

@bmk266 you can sure use but it will be string

 

Sum = 
VAR __selectedValue = SELECTEDVALUE ( Table[Key] )
VAR __sum = SUM ( Table[Value] )
RETURN
IF ( __selectedValue = "Units", FORMAT( __sum, "General Number" ), 
FORMAT ( __sum, "Currency" 
)

 






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

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





Highlighted
Regular Visitor

Re: Dynamically Change Format In Visual

thank you - but as you mentioned it is a string, so you can only put it in a tooltip.  

 

So does this mean there is no way to dynamically change the format in a visual?   

 

And if not, can we remove the Value from the tooltip so all it sees is the string?

 

 

Highlighted
Super User VII
Super User VII

Re: Dynamically Change Format In Visual

@bmk266 correct, you cannot use it in visual like bar chart etc but you can surely use it in Card Visual, Yes you can use it in tooltip, and to remove actual value from tooltip, you can create custom tooltip page that allows you to choose whatever you want to show on tooltip






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

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





Highlighted
Regular Visitor

Re: Dynamically Change Format In Visual

that's crazy you can't dynamically change formatting on a visual.  such a basic feature.  thanks though.

Highlighted
Community Support
Community Support

Re: Dynamically Change Format In Visual

Hi @bmk266 ,

 

I sincerely invite you to submit your idea if you want:

https://ideas.powerbi.com/.

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
Meet the 2020 Season 2 Power BI Super Users!

Meet the 2020 Season 2 Power BI Super Users!

Find out who's part of the program this season, and welcome the new Super Users.

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.

Top Solution Authors
Top Kudoed Authors