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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
databot_kd
Helper II
Helper II

How to Sum Row Count and show total sum value in every row

Hi community, 

Hoping you can assist, i am trying to Sum my count and show the total in a new column for every row. 

See below:

Total Occupany is a measure counting the records based on my slicer selection. I

I am trying to sum the count values into a new column and show the value in every row. 

databot_kd_0-1681964980600.png

 


Thanks in Advance

1 ACCEPTED SOLUTION

Can you try like below 

 

CountRows AllSelected = CALCULATE ( [CountRoomOccWGroup], ALLSELECTED ( 'Room' ) )

Even if your measure [CountRoomOccWGroup], look strange for me, i don't understand why you need to apply allexcept in that way. 

 

By taking a similar model to yours, i have the expected result

Capture_1.pngCapture_2.png

 

find the pbix here

View solution in original post

6 REPLIES 6
databot_kd
Helper II
Helper II

thanks @ced_f , your solution worked.
Thanks for sharing and assisting.

databot_kd
Helper II
Helper II

hi @ced_f 


thanks for getting back.. I tried the code but does not seem to produce the right result still. 

 

databot_kd_1-1681978830364.png

Also tried the same with KEEPFILTERS 

Seem the Sum calculation ignores the selected values in the slicer and counts all the records in the table 

 

If you have some others filters that need to be keep, in that case you can use ALLSELECTED function (to use with precaution as it's pretty complex as function).

Without more details in your model, it's little hard to tell you how to use it properly. 

One way which can work is. 

CALCULATE (SUM(factRoomOccupancy[CountRoomOccWGroup]), ALLSELECTED(factRoomOccupancy[CA_Name]))

 

Here the idea is to get the total for "All" available "CA_Name" values in the context. 

 

Regards

 

Hi @ced,

Still was not able to get it to work. 

databot_kd_1-1681986722928.png

 

This is how i am calculating the roomoccupancycount:

CountRoomOccWGroup = CALCULATE(
        COUNT(Room[Row]),
              ALLEXCEPT(Room, Room[Date], Room[Site], Room[Camp], Room[WorkG])
        )


Which is used in the SumRowCount calc

Below is what the model looks like, i not able to attache a file else i would have.
But it is quite simple model 

databot_kd_0-1681986686400.png

 






Can you try like below 

 

CountRows AllSelected = CALCULATE ( [CountRoomOccWGroup], ALLSELECTED ( 'Room' ) )

Even if your measure [CountRoomOccWGroup], look strange for me, i don't understand why you need to apply allexcept in that way. 

 

By taking a similar model to yours, i have the expected result

Capture_1.pngCapture_2.png

 

find the pbix here

ced_f
Frequent Visitor

You can use a piece of code like : 

CALCULATE (SUM(Table[Total Occupancy]), REMOVEFILTERS(Table))

Regards

Cedric

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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