Format Switch in Power BI (DAX)

Asked

Viewed 162 times

0

good night!

I’m new to DAX and I’d like a hand with the following question:

Meta Formatada = SWITCH
(KPI.Formatacao
, "Money", FORMAT([Meta],"Currency")
, "Numeric", FORMAT([Meta],"General Number")
               , "Unknown value" )  

"KPI.Formatting" is my "table.column" I would like to understand if it is possible and how I can make a switch on top of a column and not an expression. If it is possible only via expression, there is some way to put the text of this column as a measure?

Thanks in advance.

1 answer

0

I was able to solve it this way:

Meta Formatada =
    SWITCH(
        TRUE (),
            SELECTEDVALUE('KPI'[Formatacao])="Money",FORMAT([Meta],"Currency"),
            SELECTEDVALUE('KPI'[Formatacao])="Percent",FORMAT([Meta],"Percent"),
            FORMAT([Meta],"Standard")
            )

Browser other questions tagged

You are not signed in. Login or sign up in order to post.