Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
How to bring this query from SQL SERVER to Power BI. I have to bring this query to a measure in Power BI and I don' t understand how to arrasnge this one. Can you help me?
SQL SERVER:
sum(CASE WHEN anama.ppcoll is null
THEN 0
ELSE
case when anama.ppcoll <> 0
then Vendite."Quantità"/ anama.ppcoll
else 0
end
END)
anama and Vendite are the TABLE, ppcoll and Quantità are the columns.
i tried to write this query on Power BI but i don't know if it's right:
Thanks!
Solved! Go to Solution.
Hello,
Try this:
Colli =
VAR _Total = SUM(anama[ppcoll])
VAR _Quantity = SUM(vendite[quantita])
VAR _Result =
SWITCH(
TRUE(),
ISBLANK(_Total), 0,
_Total <> 0, DIVIDE(_Quantity, _Total),
0)
RETURN _Result
If it answers your needs, please mark my reply as the solution
Hello,
Try this:
Colli =
VAR _Total = SUM(anama[ppcoll])
VAR _Quantity = SUM(vendite[quantita])
VAR _Result =
SWITCH(
TRUE(),
ISBLANK(_Total), 0,
_Total <> 0, DIVIDE(_Quantity, _Total),
0)
RETURN _Result
If it answers your needs, please mark my reply as the solution
Thank you a lot, i will try this solution!
User | Count |
---|---|
97 | |
87 | |
77 | |
67 | |
63 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
59 |