1

I have this measure in DAX:

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

)

I would like the first one to have one decimal, but not the second one.

Can I do a formatting for one row only?

As of now, I have it like this for the entire measure: enter image description here

Chicago1988
  • 970
  • 3
  • 14
  • 35
  • 1
    Yes, but only by sticking `FORMAT` in the expression and making it text, which causes issues -- charts stop working and sorting values doesn't work properly (since both of these require numbers). Not an issue if you only need this for display purposes in a fixed table. – Jeroen Mostert May 16 '22 at 15:39

1 Answers1

1

Here are a few options:

  1. Like Jeroen said, you can use FORMAT in your measure but it will be text. If you can't have the measure as text is some places, just have a text measure and a number measure.
  2. Use two measures, one for hours and one for dollars. You can't really chart or SUM things well when sometimes it's hours and sometimes it's dollars, so split them out.
  3. You could always drop the decimals on the dollars and use whole number for both.
  4. If your data for both is always positive, you can play tricks with the positive and negative formats in Power BI (and probably SSAS?) using a custom format string such as 0.00;0;0. In a custom format string, the first format is the positive number, the second is negative, and the last is zero. The trick is to use the positive format for dollars and the negative format for hours. Here, positive numbers are shown with decimals (0.00), negative numbers are shown as whole numbers without a minus sign so that they look like positive numbers (0): enter image description here
TheRizza
  • 1,577
  • 1
  • 10
  • 23