Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
katemarkoska
Frequent Visitor

Map a LocalAccount to GlobalAccountPositive or GlobalAccountNegative based on the sum of the Amount

Hi,
I'm trying to do a Balance Sheet report and I need to map Local Accounts to GlobalAccounts.
If the sum(Amount) for the LocalAccount of all data until the selected period is >=0 then map it to GlobalAccountPositive, if the sum(Amount) is less than 0, than map it to GlobalAccountNegative. 
I tried doing this with a calculated column in DAX

VAR Positive = VALUE('GenLedgEntries'[GlobalAccountPositive])
VAR Negative= VALUE('GenLedgEntries'[GlobalAccountNegative])
VAR maxdate=MAX('Date'[datekey])
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @katemarkoska ,

 

I created some data:

vyangliumsft_0-1707876561251.png

 

Here are the steps you can follow:

1. Create measure.

Measure =
var _sum=
SUMX(ALLSELECTED('Table'),[Amount])
return
IF(
    _sum>= 0 ,MAX('Table'[GlobalAccountPositive]),MAX('Table'[GlobalAccountNegative]))

2. Result:

vyangliumsft_1-1707876561252.png

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi  @katemarkoska ,

 

I created some data:

vyangliumsft_0-1707876561251.png

 

Here are the steps you can follow:

1. Create measure.

Measure =
var _sum=
SUMX(ALLSELECTED('Table'),[Amount])
return
IF(
    _sum>= 0 ,MAX('Table'[GlobalAccountPositive]),MAX('Table'[GlobalAccountNegative]))

2. Result:

vyangliumsft_1-1707876561252.png

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.