Forum Discussion
Visual showing blank rows using SELECTEDVALUE and FORMAT Function
- 8 years ago
Hi Anonymous,
We only need to add a condition like below.
CB Data = IF ( SELECTEDVALUE ( 'CB Selection'[CB Selection] ) = "Eaches", FORMAT ( [CB Eaches], "#,##0;(#,##0)" ), IF ( SELECTEDVALUE ( 'CB Selection'[CB Selection] ) = "Net Sales", FORMAT ( [CB Contract Value], "$#,##0;($#,##0)" ), IF ( ISBLANK ( 'CB Selection'[CB Selection] ), BLANK (), FORMAT ( [CB MS%], "0.0%;(0.0%)" ) ) ) )Best Regards,
Dale
Hi Anonymous,
We only need to add a condition like below.
CB Data =
IF (
SELECTEDVALUE ( 'CB Selection'[CB Selection] ) = "Eaches",
FORMAT ( [CB Eaches], "#,##0;(#,##0)" ),
IF (
SELECTEDVALUE ( 'CB Selection'[CB Selection] ) = "Net Sales",
FORMAT ( [CB Contract Value], "$#,##0;($#,##0)" ),
IF (
ISBLANK ( 'CB Selection'[CB Selection] ),
BLANK (),
FORMAT ( [CB MS%], "0.0%;(0.0%)" )
)
)
)
Best Regards,
Dale
- Anonymous8 years agoNot applicable
CB Data = IF ( SELECTEDVALUE ( 'CB Selection'[CB Selection] ) = "Eaches", FORMAT ( [CB Eaches], "#,##0;(#,##0)" ), IF ( SELECTEDVALUE ( 'CB Selection'[CB Selection] ) = "Net Sales", FORMAT ( [CB Contract Value], "$#,##0;($#,##0)" ), IF ( ISBLANK ( 'CB MS%] ), BLANK (), FORMAT ( [CB MS%], "0.0%;(0.0%)" ) ) ) )Had to make one change to get it to work, but that did the trick! What does it only need to be applied to that measure?
THANKS!
- v-jiascu-msft8 years ago
Microsoft Employee
Hi Anonymous,
Please refer to format-function-dax.
>>>If value is BLANK() the function returns an empty string.
Best Regards,
Dale
- bertalan_ronai5 years ago
Advocate I
Thank you su much for this!
- RobbLewz3 years ago
Helper II
Are microsoft not treating this as a bug?
Using if is blank over a large dataset isn't practical.- IP_Kornel2 years agoFrequent Visitor
I agree, this is crazy. In my case I need the percentage forma. Either I have an empty row that I need to filter out later from visual or check for blanks and leave them as they are and rest format to percent values. That second options makes for example one row with 5.43% and next row is 0.00 without % sign that looks plain stupid.