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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello friends,
In my Cash flow model I have Accounts with their Groups.
Each period (month, quater, etc.) any Group can either receive cash (positive sign) or pay cash (negative sign).
I need to build 2 measures: "Net Received by Group" and "Net Paid by Group" - depending on a sign of a Group on dynamic period.
If a Group received cash (positive), than all the accounts within it have to be included in the "Net Received by Group" measure - even those accounts that have a negative sign on that period.
My thinking was more like SQL: I first get a list of groups that have positive sign, then I calculate an amount for all the accounts with these groups:
-- SQL Net Received by Group for all period
select SUM(Amt)
from Fact f join Accounts a on f.Account = a.Account
where a.Account_Group in (
select p.Account_Group from
(-- all groups with positive amount
select a.Account_Group, SUM(f.Amt)
from Fact f join Accounts a on f.Account = a.Account
group by a.Account_Group
having SUM(f.Amt)>0) p
) g
So I wrote this DAX measure. It works on a Group or total level, but not at the account level...
It somehow detects the sign at the account level (when I have account in visual), but I need it to always check at the Group Level.
Please help.
Attached is .pbix file
Solved! Go to Solution.
Hi @michaelsh
Are you looking for this result?
Net Paid by Group 1 =
SUMX(VALUES(Accounts[Account Group]),IF(SUMX(ALL(Accounts[Account]),[Cash Flow Amount])<0,[Cash Flow Amount]))
Net Received by Group 1 =
SUMX(VALUES(Accounts[Account Group]),IF(SUMX(ALL(Accounts[Account]),[Cash Flow Amount])>0,[Cash Flow Amount]))
Hi @michaelsh
Are you looking for this result?
Net Paid by Group 1 =
SUMX(VALUES(Accounts[Account Group]),IF(SUMX(ALL(Accounts[Account]),[Cash Flow Amount])<0,[Cash Flow Amount]))
Net Received by Group 1 =
SUMX(VALUES(Accounts[Account Group]),IF(SUMX(ALL(Accounts[Account]),[Cash Flow Amount])>0,[Cash Flow Amount]))
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!