Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

FORMAT - Switch and IF

Hi All,

 

I need to change my Switch calculation to remove the BLANK()

Var =
IF (
    HASONEVALUE (Swap[Measure]),
    SWITCH (
        VALUES (Swap[Measure]),
        "Sales",FORMAT('Sales'[Number],"#,##"),
        "Qty",FORMAT(SUM('Sales'[Qty]),"€#,##0.##")
        ),
     FORMAT(SUM('Sales'[Qty],"#,##")
)

 

The scenario I am working on is similar to the below post :

https://community.fabric.microsoft.com/t5/Desktop/FORMAT-ignores-filter/td-p/1161371

 

Can you please help how to remove the null values but also take care of the formatting?

 

I just need to update the above calculation to remove the NULL values which show up when I use the FORMAT within the calculation. Thanks

13 Replies