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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mypowerbi1
Helper III
Helper III

format data after transpose table

Hi,

I got the data from source in this format:

mypowerbi1_2-1655102653625.png

 

I have applied transpose table on this and now data is coming as per the expectation :

mypowerbi1_3-1655102688690.png

 

I am experiencing trouble to format the individual row's values. Avg Sale value should be in % format, Total sales should have $ before the value, Pending sshould be decimal but all this not possible because these are not column but rows. 

I have tried to set formating in power query 1 step before the transpose table but it got vanished after transpose table step.

 

Please suggest how to set the formatting for as required above.

Thanks

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @mypowerbi1 ,

It is not possible to display multiple different formats on the same column. You can use the format() function to convert the table to the form you want after Unpivoting the table, but both are text types.

Here are the steps you can follow:

1. In the power query, except [Group], the rest are selected – Unpivot Columns.

vyangliumsft_0-1655368102621.png

2. Create measure.

Measure =
SWITCH(
    TRUE(),
    MAX('Table2'[Attribute])= "Total sales",FORMAT( MAX('Table2'[Value]),"$#,##0"),
    MAX('Table2'[Attribute])= "Pending",FORMAT(MAX('Table2'[Value]),"Fixed"),
    MAX('Table2'[Attribute])="Avg Sale",FORMAT(MAX('Table2'[Value]),"Percent"),
    FORMAT(MAX('Table2'[Value]),"General Number")
    )

3. Result:

vyangliumsft_1-1655368102623.png

 

Best Regards,

Liu Yang

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

View solution in original post

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @mypowerbi1 ,

It is not possible to display multiple different formats on the same column. You can use the format() function to convert the table to the form you want after Unpivoting the table, but both are text types.

Here are the steps you can follow:

1. In the power query, except [Group], the rest are selected – Unpivot Columns.

vyangliumsft_0-1655368102621.png

2. Create measure.

Measure =
SWITCH(
    TRUE(),
    MAX('Table2'[Attribute])= "Total sales",FORMAT( MAX('Table2'[Value]),"$#,##0"),
    MAX('Table2'[Attribute])= "Pending",FORMAT(MAX('Table2'[Value]),"Fixed"),
    MAX('Table2'[Attribute])="Avg Sale",FORMAT(MAX('Table2'[Value]),"Percent"),
    FORMAT(MAX('Table2'[Value]),"General Number")
    )

3. Result:

vyangliumsft_1-1655368102623.png

 

Best Regards,

Liu Yang

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

rajulshah
Super User
Super User

Hello @mypowerbi1 ,

 

This is only possible using Power BI measures and then formatting the measures as you want. We cannot have multiple data types for a single column.

SanketBhagwat
Solution Sage
Solution Sage

Hi @mypowerbi1 
Data type format in Power BI is according to column and not rows.

Please refer the below link;
https://community.powerbi.com/t5/Desktop/Format-on-Row-but-not-columns/m-p/65683


If this post helps, then mark it as "Accept as Solution" and give it a thumbs up.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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