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.
I need help to compute a Column called Total which is a measure. I have 2 slicer Country and Date . if Country is "India" alone . I hve 2 conditions
1) Sum the Loan by Comp and also country
2) Sum the Balance column by Comp but excluding the slicer Country if its India alone. I have attached the Input data and expected result showing how to arrive.
Challenge is SUM Balance for All the country If India is Selected . I am also using Dimension table for Country for Slicer
Fact Table
Country | Comp | Date | Loan | Balance |
India | Accen | 7/31/2023 | 10 | |
USA | Microsoft | 7/31/2023 | 5 | |
Japan | Apple | 7/31/2023 | 0 | 2 |
China | 7/31/2023 | 0 | 2 | |
India | Microsoft | 7/31/2023 | 2 | |
USA | Microsoft | 7/31/2023 | 5 | |
India | Apple | 7/31/2023 | 0 | 5 |
China | Accen | 7/31/2023 | 5 | |
China | Accen | 7/31/2023 | 5 |
Expected Result :
Solved! Go to Solution.
Hi @swasim ,
You can create the measures as below to get it, please find the details in the attachment.
Measure =
VAR _selcountry =
SELECTEDVALUE ( 'Countries'[Country] )
VAR _comps =
CALCULATETABLE (
VALUES ( 'Table'[Comp] ),
FILTER ( 'Table', 'Table'[Country] = _selcountry )
)
VAR _loan =
CALCULATE (
SUM ( 'Table'[Loan] ),
FILTER ( 'Table', 'Table'[Country] = _selcountry )
)
VAR _balance =
CALCULATE (
SUM ( 'Table'[Balance] ),
FILTER (
'Table',
IF ( _selcountry = "India", 1 = 1, 'Table'[Country] = _selcountry )
&& 'Table'[Comp] IN _comps
)
)
RETURN
_loan + _balance
Sum of Loan = SUMX(VALUES('Table'[Comp]),[Measure])
Best Regards
Hi @swasim ,
You can create the measures as below to get it, please find the details in the attachment.
Measure =
VAR _selcountry =
SELECTEDVALUE ( 'Countries'[Country] )
VAR _comps =
CALCULATETABLE (
VALUES ( 'Table'[Comp] ),
FILTER ( 'Table', 'Table'[Country] = _selcountry )
)
VAR _loan =
CALCULATE (
SUM ( 'Table'[Loan] ),
FILTER ( 'Table', 'Table'[Country] = _selcountry )
)
VAR _balance =
CALCULATE (
SUM ( 'Table'[Balance] ),
FILTER (
'Table',
IF ( _selcountry = "India", 1 = 1, 'Table'[Country] = _selcountry )
&& 'Table'[Comp] IN _comps
)
)
RETURN
_loan + _balance
Sum of Loan = SUMX(VALUES('Table'[Comp]),[Measure])
Best Regards
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.
User | Count |
---|---|
12 | |
11 | |
10 | |
9 | |
8 |