This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
I need to get net amt for loc_group with loc_group 1034 total amt is excluding the amt that was send to other loc_group.
the situation as below:
below table represent loc_group and supp_code total amt. Only 1034 will buy item c from supp_code S-03 and will send 1 to other loc_group.
This is purchase table
and this is transfer table
I have both table in power BI
below is the expected outcome:
so far I cannot seperate the amt from 1034 in powerBI
thank you;
Solved! Go to Solution.
Hi,
I am not sure how your data model looks like, but please check the below picture and the attached pbix file.
Amount total expected result: =
VAR _expected =
SUM ( Purchase[amt] )
- CALCULATE (
SUM ( Purchase[amt] ),
FILTER ( ALL ( Purchase ), Purchase[supp_code] = "1034" )
)
RETURN
IF (
HASONEVALUE ( loc_group[loc_group] ),
SWITCH (
SELECTEDVALUE ( loc_group[loc_group] ),
"1034", _expected,
SUM ( Purchase[amt] )
),
_expected
)
Hi,
I am not sure how your data model looks like, but please check the below picture and the attached pbix file.
Amount total expected result: =
VAR _expected =
SUM ( Purchase[amt] )
- CALCULATE (
SUM ( Purchase[amt] ),
FILTER ( ALL ( Purchase ), Purchase[supp_code] = "1034" )
)
RETURN
IF (
HASONEVALUE ( loc_group[loc_group] ),
SWITCH (
SELECTEDVALUE ( loc_group[loc_group] ),
"1034", _expected,
SUM ( Purchase[amt] )
),
_expected
)
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 25 | |
| 24 | |
| 22 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 43 | |
| 21 | |
| 21 |