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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AllanBerces
Post Prodigy
Post Prodigy

Combine Sum per Row

Hi good day,

Can someone help me on my table, is there a way to sum the two area per row

  Asia Week1 + North Week 1 = Combine Week 1

AllanBerces_0-1738214710045.png

DESIRED OUTPUT

AllanBerces_1-1738214767511.png

Thank you

1 ACCEPTED SOLUTION

Hi @AllanBerces - please check this

 

rajendraongole1_0-1738217925462.png

 

Actual Remaining =
IF(
    Input[Area] = "Combine",
    VAR WeekNum = Input[Week No.]
    RETURN
        SUMX(
            FILTER(
                Input,
                Input[Area] IN {"Asia", "North"} && Input[Week No.] = WeekNum
            ),
            Input[Remaining]
        ),
    Input[Remaining]
)
 
rajendraongole1_1-1738217949467.png

 

 

Hope this would help





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

9 REPLIES 9
Abhijeet_40
Helper I
Helper I

It can be done using a pivot table.

Abhijeet_40_0-1738216264811.png

This can also be done using a measure.

Abhijeet_40_1-1738218386622.png

Total Remaining =
VAR CurrentArea = SELECTEDVALUE('Table'[Area])
VAR CurrentWeek = SELECTEDVALUE('Table'[Week])

RETURN
IF(
    CurrentArea = "Combine",
    CALCULATE(
        SUM('Table'[Remaining]),
        ALL('Table'),  -- Remove all filters
        'Table'[Area] IN { "Asia", "North" },
        'Table'[Week] = CurrentWeek
    ),
    SUM('Table'[Remaining])
)
rajendraongole1
Super User
Super User

Hi @AllanBerces - I have tried with measure as follows with one table input with above details. 

 

Actual Remaining Measure =
VAR WeekNum = SELECTEDVALUE(Input[Week No.])
RETURN
    CALCULATE(
        SUM(Input[Remaining]),
        Input[Area] IN {"Asia", "North"},
        Input[Week No.] = WeekNum
    )
 
can you please check this.
rajendraongole1_0-1738216726506.png

 

Hope it helps.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @rajendraongole1 thank you fo the reply but i need calculated column. I tried the one you provided in column but no luck.

Hi @AllanBerces - please check this

 

rajendraongole1_0-1738217925462.png

 

Actual Remaining =
IF(
    Input[Area] = "Combine",
    VAR WeekNum = Input[Week No.]
    RETURN
        SUMX(
            FILTER(
                Input,
                Input[Area] IN {"Asia", "North"} && Input[Week No.] = WeekNum
            ),
            Input[Remaining]
        ),
    Input[Remaining]
)
 
rajendraongole1_1-1738217949467.png

 

 

Hope this would help





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi @rajendraongole1 thank you very much for the reply, working perfectly

@AllanBerces -Happy to Help

Thank you





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Jihwan_Kim
Super User
Super User

Hi,

I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_1-1738215985615.png

 

 

Jihwan_Kim_0-1738215955679.png

 

 

Actual Remaining measure: = 
SWITCH (
    SELECTEDVALUE ( area[area] ),
    "Combine", CALCULATE ( SUM ( data[remaining] ), ALL ( area[area], area[sort_order] ) ),
    SUM ( data[remaining] )
)

 


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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi @Jihwan_Kim thank you for the reply, I have only 1 table with Column Area, Week No. and Remaining.

 

Hi,

I suggest having a proper data model (star schema), but if you only have one table and cannot change the model, please try something like below.

 

Jihwan_Kim_0-1738216861425.png

 

 

Actual Remaining measure: = 
SWITCH (
    SELECTEDVALUE ( data[area] ),
    "combine", CALCULATE ( SUM ( data[remaining] ),  ALL ( data[area] ) ),
    SUM ( data[remaining] )
)

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.