cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ExtraRice
New Member

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-polly-msft
Community Support
Community Support

Hi @ExtraRice , 

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

3 REPLIES 3
v-polly-msft
Community Support
Community Support

Hi @ExtraRice , 

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.

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

amitchandak
Super User
Super User

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



Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Dev Camp Session 30

Ted's Dev Camp - January 26, 2023

This session will provide guidance and teach campers the skills required to build Power BI reports that support multiple languages.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.