Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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")
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.