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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

differnt formats within a measure?

I have this measure in DAX:

SWITCH ( TRUE () ,
 MIN ( 'Dynam'[ID] ) = 5 , DIVIDE ( [Gross] , [Revenue] ) * 100,    
 MIN ( 'Dynam'[ID] ) = 8 ,  [Hours]

)

 

I would like different formats for 1st and 2nd row... I would like the first one to have one decimal, but not the second one.

 

Can I do a formatting for one row only? (in either DAX or Power BI)

2 REPLIES 2
AilleryO
Memorable Member
Memorable Member

Hi,

 

Did you try using FORMAT function ?

FORMAT( [measure or var] , "$ 0.0" ) 

Let us know

tamerj1
Super User
Super User

Hi @Anonymous 

you can use FORMAT function to return the desired format of each result separately. For example 

MyMeasure =
SWITCH (
    TRUE (),
    MIN ( 'Dynam'[ID] ) = 5, FORMAT ( DIVIDE ( [Gross], [Revenue] ) * 100, "#0.0" ),
    MIN ( 'Dynam'[ID] ) = 8, [Hours]
)

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.