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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Astronomique
Helper I
Helper I

DIfferent types of Units in one column (Matrix) Help

Dear all,

 

I have an issue with the formatting of the units. I currently have a matrix with two levels of headers and one column as a value :

 

Astronomique_1-1616513386917.png

 

I obtained it by unpivoting in Power query my data then use a matrix visual.

 

Astronomique_0-1616513171515.png

 

I'm pretty happy about the outcome of the visual as it is doing what i want, however as you can see some columns are meant to be in percentage not value, but as far as i know i can only choose one type per value, so that's mean it's either a whole number or percentage...

 

Is there any way to do custom type formatting according to the attribute of the value ?

i.e : have whole number for some columns and percentage for others ?

 

Let me know if you need additional information.

 

Thanks in advance for your help.

 

Best regards.

 

Astronomique.

 

 

 

1 ACCEPTED SOLUTION
Astronomique
Helper I
Helper I

I found a work around :

 

Astronomique_0-1616521878196.png

 

By using a switch and a calculated column :

 

 

 

Value Formatted = SWITCH (
    TRUE (),
    [Attribute] = "% Received" , FORMAT('Follow-up'[Value]*100, "0")&" %",
    [Attribute] = "% projected", FORMAT('Follow-up'[Value]*100, "0")&" %",
    FORMAT(INT([Value]),"#")
)

 

 

 

Now i need to sort out how to manage conditionnal formatting on colors ... Wish me good luck

View solution in original post

6 REPLIES 6
Astronomique
Helper I
Helper I

I found a work around :

 

Astronomique_0-1616521878196.png

 

By using a switch and a calculated column :

 

 

 

Value Formatted = SWITCH (
    TRUE (),
    [Attribute] = "% Received" , FORMAT('Follow-up'[Value]*100, "0")&" %",
    [Attribute] = "% projected", FORMAT('Follow-up'[Value]*100, "0")&" %",
    FORMAT(INT([Value]),"#")
)

 

 

 

Now i need to sort out how to manage conditionnal formatting on colors ... Wish me good luck

negi007
Community Champion
Community Champion

@Astronomique you can create seperate measure that you want to show in the column and then define format for each measure as per your requirements.




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

Yes that was a work around but in my case i wanted to keep the hierachy of the headers.

 

So far by unpivoting two times: i have two values : 1 for whole numbers and one for percentage.

 

But the headers are not looking good i have :

 

TOP HEADER

Header A             |      Header B

value A value B        value A value B

 

When i would like to have 

 

TOP HEADER

Header A | Header B

 

Value A     Value B

 

is there anyway to work around with a measure and a switch() ?

I tried to use a calculated column to do that but apparently it gives back " you cannot yield data format in a calculated column

 

If you have any other ideas, let me know. I am still searching for a solution on my own.

 

 

 

amitchandak
Super User
Super User

@Astronomique , refer to this blog, this can help

https://radacad.com/dynamically-change-the-format-of-values-in-power-bi

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi thanks for your link. 

 

i had that idea of switch but so far does not work for a calculated column. trying to use it in a measure.

Will keep you updated.

Astronomique_0-1616520097008.png

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.