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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Dimitris_Kats
Helper V
Helper V

Format by row and not column (data type)

Hello dear members,

I have a problem and I do not know how I could handle it.

In the same column I have different units of measurement. For example, I can have currency, kgs, percentage and I cannot format them properly (I have as a column type text and number).

When I present the data in a report, they don’t have the appropriate format.

Is there a way to format by row instead of column?

 

Thank you in advance

1 ACCEPTED SOLUTION
serpiva64
Solution Sage
Solution Sage

Hi, 

you can try something like this (look only the format)

Column = if(dimProduct[WeightUnitMeasureID]="grams", FORMAT(dimProduct[Weight],"Fixed"), FORMAT(dimProduct[Weight]/100,"Percent"))

serpiva64_0-1648548220477.png

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

 

View solution in original post

6 REPLIES 6
Dimitris_Kats
Helper V
Helper V

@serpiva64 the problem was the column format. I removed the symbols and i changed the format from text to number and the DAX was working perfectly.

Thank you very very much!!

Dimitris_Kats
Helper V
Helper V

Thank you very much for your replies.

 

Unfortunately I can't create multiple columns for this problem or save them with symbols as text.

 

Thank you very much for your time. Your effort is greatly appreciated

serpiva64
Solution Sage
Solution Sage

Hi, 

you can try something like this (look only the format)

Column = if(dimProduct[WeightUnitMeasureID]="grams", FORMAT(dimProduct[Weight],"Fixed"), FORMAT(dimProduct[Weight]/100,"Percent"))

serpiva64_0-1648548220477.png

If this post is useful to help you to solve your issue consider giving the post a thumbs up 

 and accepting it as a solution !

 

Hello @serpiva64 
Thank you very much for your reply.

Your solution is exactly what i need but it doesn't working. I get the exact same values 😞
Should i change the type of the new calculated column?
What might be the problem?

mussaenda
Super User
Super User

Hi @Dimitris_Kats 

 

You can use FORMAT from DAX to how you wanted it to be.

You can also unpivot the data if you are open to turn them into columns instead of rows.

 

Hope this helps.

 

Vijay_A_Verma
Super User
Super User

At column level, it will be only one data type. If you want to store more than one data type in a column, then make the column text type and store these data. Hence, store the data like 12.45%, $348.95, 45.6 kgs...You will have to treat these different data types when you read them for further processing. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.