Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I am writing a formula to calculate fund balances for the beginning of the year from our accounting software. What I want is that for funds that are less then 600 or greater than 699 I want them to equal account code: "32400-0" but if they are in the 600s I want the following sum x formula:
Solved! Go to Solution.
Okay. so I am getting closer, but the issue is that that the test only is displaying 32400-0 and not the dollar amount of that actual account. I have tried putting a sumx infront of that 32400 but that is not working either
Hi @Anonymous
Not sure whether your issue has been resolved. Do some complements to the dax formula from Alexis here to make it more clear. This is a Measure formula.
Fund Balance =
IF (
SELECTEDVALUE ( 'TableName'[FundNumber] ) < 600
|| SELECTEDVALUE ( 'TableName'[FundNumber] ) > 699,
"32400-0",
CALCULATE (
SUMX ( 'Cash2021', [ACTIVITY-BB] ),
FILTER (
'Accounts',
'Accounts'[Full Code] = "10400-0"
|| Accounts[Full Code] = "11200-0"
|| Accounts[Full Code] = "20100-0"
)
)
)
If your "fund number" is a Measure got from calculation, just replace SELECTEDVALUE('TableName'[FundNumber]) with it. If your issue has been resolved by these formulas, could you please kindly mark the solution to help others find it more quickly? If you still have problems on it, please feel free to let us know. Thanks a lot!
Best Regards,
Community Support Team _ Caiyun
Okay. so I am getting closer, but the issue is that that the test only is displaying 32400-0 and not the dollar amount of that actual account. I have tried putting a sumx infront of that 32400 but that is not working either
Figured it out I did it the long way like this
I think this might be what you're looking for:
Fund Balance =
IF (
SELECTEDVALUE ( 'TableName'[FundNumber] ) < 600
|| SELECTEDVALUE ( 'TableName'[FundNumber] ) > 699,
CALCULATE (
SUMX ( 'Cash2021', [ACTIVITY-BB] ),
FILTER ( 'Accounts', 'Accounts'[Full Code] = "32400-0" )
),
CALCULATE (
SUMX ( 'Cash2021', [ACTIVITY-BB] ),
FILTER (
'Accounts',
'Accounts'[Full Code] IN { "10400-0", "11200-0", "20100-0" }
)
)
)
If those are your only two options, then an IF function is fine. If you had more, you'd probably want SWITCH ( TRUE, ... ).
IF (
[FundNumber] < 600 || [FundNumber] > 699,
[Measure 32400],
[Measure 10400 + 11220 + 20100]
)
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
9 | |
9 | |
6 | |
5 |
User | Count |
---|---|
19 | |
18 | |
9 | |
9 | |
8 |