Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hey There
So i have this two SQL Select. I want to make a measure with the Total off Select1 - Select2 but cant get it to work. Have tried with CALCULATE,SUM,Switch and Filter functions but im to new to power bi to get it to work. Woule appreicate if someone could help me.
SELECT SUM(BetragSw) FROM bi_Budget
WHERE Konto_KontoNrFIB IN ('344100') and Buchungen_KontoNrFIB = '344100'
-
SELECT SUM(BetragSw) FROM bi_Budget
WHERE Konto_KontoNrFIB IN ('344100') and GegKontoNr = '344100'
You can use variable in your dax syntex. First variable to store value from first condition and second variable to store value from second condition. Then you can sum easily value of first and second variable to calculate sum of two conditions.
your syntex could be like below:-
Total :=
VAR
Buchungen = CALCULATE (SUM ( Sales[BetragSw] ), Buchungen_KontoNrFIB = '344100' ))
VAR
GegKontoNr = CALCULATE (SUM ( Sales[BetragSw] ), GegKontoNr = '344100' ))
RETURN
(Buchungen + GegKontoNr)
Proud to be a Super User!
@Jensej , try like
calculate(sum(bi_Budget[BetragSw]),bi_Budget[Konto_KontoNrFIB] IN {"344100"},bi_Budget[Buchungen_KontoNrFIB] = "344100")
calculate(sum(bi_Budget[BetragSw]),bi_Budget[Konto_KontoNrFIB] IN {"344100"},bi_Budget[GegKontoNr] = "344100")
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |