Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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")
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.