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
Anonymous
Not applicable

Change Data Type in Specific Rows

I have a table that is transponsed from Rows to Column to Colum to Rows.  Is it possible to change data type on specific rows from a transposed table.

Here is the transposed table: 

ExtraRice_0-1646035954918.png

 

Thank you

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

Hi @Anonymous , 

Please refer to my pbix to see if it helps you.

Create two measures.

2022/01 =
VAR small_0 =
    IF (
        MAX ( 'Table'[2022/January] ) < 1,
        FORMAT ( MAX ( 'Table'[2022/January] ), "percent" ),
        MAX ( 'Table'[2022/January] )
    )
VAR _large_0 =
    IF (
        MAX ( 'Table'[2022/January] ) > 1,
        FORMAT ( MAX ( 'Table'[2022/January] ), "0.0000" ),
        MAX ( 'Table'[2022/January] )
    )
RETURN
    IF ( MAX ( 'Table'[2022/February] ) < 1, small_0, _large_0 )
2022/02 =
VAR small_0 =
    IF (
        MAX ( 'Table'[2022/February] ) < 1,
        FORMAT ( MAX ( 'Table'[2022/February] ), "percent" ),
        MAX ( 'Table'[2022/February] )
    )
VAR _large_0 =
    IF (
        MAX ( 'Table'[2022/February] ) > 1,
        FORMAT ( MAX ( 'Table'[2022/February] ), "0.0000" ),
        MAX ( 'Table'[2022/February] )
    )
RETURN
    IF ( MAX ( 'Table'[2022/February] ) < 1, small_0, _large_0 )

vpollymsft_0-1646286571469.png

If I have misunderstood your meaning, please provide your pbix file and desired output.

 

Best Regards

Community Support Team _ Polly

 

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

4 REPLIES 4
v-rongtiep-msft
Community Support
Community Support

Hi @Anonymous , 

Please refer to my pbix to see if it helps you.

Create two measures.

2022/01 =
VAR small_0 =
    IF (
        MAX ( 'Table'[2022/January] ) < 1,
        FORMAT ( MAX ( 'Table'[2022/January] ), "percent" ),
        MAX ( 'Table'[2022/January] )
    )
VAR _large_0 =
    IF (
        MAX ( 'Table'[2022/January] ) > 1,
        FORMAT ( MAX ( 'Table'[2022/January] ), "0.0000" ),
        MAX ( 'Table'[2022/January] )
    )
RETURN
    IF ( MAX ( 'Table'[2022/February] ) < 1, small_0, _large_0 )
2022/02 =
VAR small_0 =
    IF (
        MAX ( 'Table'[2022/February] ) < 1,
        FORMAT ( MAX ( 'Table'[2022/February] ), "percent" ),
        MAX ( 'Table'[2022/February] )
    )
VAR _large_0 =
    IF (
        MAX ( 'Table'[2022/February] ) > 1,
        FORMAT ( MAX ( 'Table'[2022/February] ), "0.0000" ),
        MAX ( 'Table'[2022/February] )
    )
RETURN
    IF ( MAX ( 'Table'[2022/February] ) < 1, small_0, _large_0 )

vpollymsft_0-1646286571469.png

If I have misunderstood your meaning, please provide your pbix file and desired output.

 

Best Regards

Community Support Team _ Polly

 

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

Hi, if we use the above calculation then the Totals are not summing up its just picking up the maximum value from the list, can you please let me know how we can have the totals that sums up as well?

 

Anonymous
Not applicable

This is what is needed!!! Thank a lot!!!!

amitchandak
Super User
Super User

@Anonymous , I doubt one column can have two data types of the decimal place. You can create a measures return different values

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.