Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
fmouhcine
Frequent Visitor

Change value's format based on another column value

Dear community,

 

Will that be possible to display  - in line or bar chart - values on different format (currency, whole num or %) based on another column ?

As you can see in the 1st screenshort from the Excel data source  where I can show the values on the desired formats

 

fmouhcine_0-1715553871279.png

 

But when I'm trying to do the same in power BI, I can't as the formatting is applied for the whole Column values

 

fmouhcine_2-1715554704168.png

 

Is there any workaround solution for this?

 

Many thanks in advance for your support.

1 ACCEPTED SOLUTION
Wilson_
Memorable Member
Memorable Member

Hi fmouhcine,

 

This involves something like:

KPI (Display) =
VAR SelKPI = SELECTEDVALUE ( Table1[KPI] )
VAR Result =
SWITCH (
    TRUE(),
    SelKPI = "Revenue", "€ " & FORMAT ( [KPI Value], "" ),
    SelKPI = "Volume", "€ " & FORMAT ( [KPI Value], "#,#" ),
    SelKPI = "Target Coverage", FORMAT ( [KPI Value], "#%" )
)

RETURN Result

 

You'll have to play around with the formatting string in the second argument of the FORMAT function, but that's the rough structure that should work for what you want.


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)

 

P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @fmouhcine ,

Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information and description to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Wilson_
Memorable Member
Memorable Member

Hi fmouhcine,

 

This involves something like:

KPI (Display) =
VAR SelKPI = SELECTEDVALUE ( Table1[KPI] )
VAR Result =
SWITCH (
    TRUE(),
    SelKPI = "Revenue", "€ " & FORMAT ( [KPI Value], "" ),
    SelKPI = "Volume", "€ " & FORMAT ( [KPI Value], "#,#" ),
    SelKPI = "Target Coverage", FORMAT ( [KPI Value], "#%" )
)

RETURN Result

 

You'll have to play around with the formatting string in the second argument of the FORMAT function, but that's the rough structure that should work for what you want.


----------------------------------
If this post helps, please consider accepting it as the solution to help other members find it quickly. Also, don't forget to hit that thumbs up and subscribe! (Oh, uh, wrong platform?)

 

P.S. Need a more in-depth consultation for your Power BI data modeling or DAX issues? Feel free to hire me on Upwork or DM me directly on here! I would love to clear up your Power BI headaches.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.