Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Jensej
Helper V
Helper V

SQL to Dax, Multiple Wheres

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'

 

2 REPLIES 2
negi007
Community Champion
Community Champion

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)




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

amitchandak
Super User
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")

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.