Forum Discussion

user2023's avatar
user2023
Regular Visitor
3 years ago

Transform SQL to DAX

I'm new to Powerbi, and I'm having trouble converting this SQL code to DAX
measure: perc_ating {
label: "∆ % Monthly Goal"
type: number
sql: case when
${perc_ating_aux} >= 0 then ${perc_ating_aux}
else 100 end
;;
value_format: "#.0\%"
}.
Can anybody help me

4 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    user2023 This would be easier with sample data and expected output but maybe try:

    perc_ating measure = IF( [perc_ating_aux] >= 0, [perc_ating_aux], 100)
    • user2023's avatar
      user2023
      Regular Visitor

      Greg_Deckler But how would I put the value format "#.0\%" for it to come within this condition?

      • R1k91's avatar
        R1k91
        Super User

        couldn't you simply use format pane for that measure?