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: 
1 Answer
Here are a few options:
- Like Jeroen said, you can use
FORMATin 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. - 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.
- You could always drop the decimals on the dollars and use whole number for both.
- 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):