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
JasMack
Frequent Visitor

Format cell row-wise instead of column-wise (field wise)

Hi all,

I have a table which looks as follows:

ParticularPrior Month (Period <2)Year to date
Cost450825
Revenue6901370
Profit %0.5333333330.660606061
Units Sold10700

 

But I want it to be formatted as the following table that is by row.

ParticularPrior Month (Period <2)Year to date
Cost £ 450.00 £ 825.00
Revenue£ 690.00 £ 1,370.00
Profit %53.33%66.06%
Units Sold10700


Can you please help me to achieve this?

Thanks.

Kind regards,
Jason

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

Hi @JasMack,

Current power bi does not support shows multiple formats in one value field, if you want to display different formats, you need to convert this field data type to text at first.

Then you can use Dax format to replace and format current results based on conditions.

Measure formulas:

P<2 = 
VAR currPart =
    SELECTEDVALUE ( 'Table'[Particular] )
VAR val =
    SUM ( 'Table'[Prior Month (Period <2)] )
RETURN
    FORMAT (
        val,
        IF (
            currPart IN { "Cost", "Revenue" },
            "Currency",
            IF ( currPart = "Profit %", "Percent", "Standard" )
        )
    )

YTD = 
VAR currPart =
    SELECTEDVALUE ( 'Table'[Particular] )
VAR val =
    SUM ( 'Table'[Year to date] )
RETURN
    FORMAT (
        val,
        IF (
            currPart IN { "Cost", "Revenue" },
            "Currency",
            IF ( currPart = "Profit %", "Percent", "Standard" )
        )
    )

1.PNG

FORMAT function (DAX) - DAX | Microsoft Learn

Regards,
Xiaoxin Sheng

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

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @JasMack,

Current power bi does not support shows multiple formats in one value field, if you want to display different formats, you need to convert this field data type to text at first.

Then you can use Dax format to replace and format current results based on conditions.

Measure formulas:

P<2 = 
VAR currPart =
    SELECTEDVALUE ( 'Table'[Particular] )
VAR val =
    SUM ( 'Table'[Prior Month (Period <2)] )
RETURN
    FORMAT (
        val,
        IF (
            currPart IN { "Cost", "Revenue" },
            "Currency",
            IF ( currPart = "Profit %", "Percent", "Standard" )
        )
    )

YTD = 
VAR currPart =
    SELECTEDVALUE ( 'Table'[Particular] )
VAR val =
    SUM ( 'Table'[Year to date] )
RETURN
    FORMAT (
        val,
        IF (
            currPart IN { "Cost", "Revenue" },
            "Currency",
            IF ( currPart = "Profit %", "Percent", "Standard" )
        )
    )

1.PNG

FORMAT function (DAX) - DAX | Microsoft Learn

Regards,
Xiaoxin Sheng

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

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.