March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
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
)
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
114 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
167 | |
117 | |
63 | |
57 | |
50 |