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
rajendraongole1
Super User
Super User

Column summarization on each row with department wise

Hi All,

 

I am actually doing the summation for row by row by using the column Current HC and dept flag but the result was coming unexpected. can you please suggest the expected output mentioned in trail mail. any help appreciate it. 

 

 

Dept FlagMonthCurrent HC
Admin6/1/202111
Admin7/1/202111
Admin8/1/202111
Admin9/1/202111
FA6/1/202169
FA7/1/202169
FA8/1/202169
FA9/1/202169
Audit6/1/202198
Audit7/1/202198
Audit8/1/202198
Audit9/1/202198

 

 

Expected Output:

Dept FlagMonthCurrent HCExpected Output
Admin6/1/20211111
Admin7/1/20211122
Admin8/1/20211133
Admin9/1/20211144
FA6/1/20216969
FA7/1/202169138
FA8/1/202169207
FA9/1/202169276
Audit6/1/20219898
Audit7/1/202198196
Audit8/1/202198294
Audit9/1/202198392

 

 

Expected output column is coming summation for each department.

 

Regards,

Rajendra





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

Proud to be a Super User!





1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

This is a cumulative total rather than a summarization.

 

See if this posts helps:
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Cumulative-Sum-by-month-per-Product/m-p/10863...

 

View solution in original post

5 REPLIES 5
AlexisOlson
Super User
Super User

This is a cumulative total rather than a summarization.

 

See if this posts helps:
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Cumulative-Sum-by-month-per-Product/m-p/10863...

 

rajendraongole1
Super User
Super User

Let me share the expected out put:

 

Below is the logic i have been used. it is deriving the cummulative sum but dept flag and date wise the date need to pick the initial value and need to perform the sum.

 

I have used the below logic in measure:

 

calculate ([total HC],FILTER(ALL(Table1),Table1[Dept Flag]<=max(Table1[Dept Flag])),FILTER(ALL(Table1),Table1[month]<=Table1[month]))))

 

 

 

expected.png





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

Proud to be a Super User!





rajendraongole1
Super User
Super User

Output result expecting :

 

cummulative summation based on dept and datewise.

 

Dept FlagMonthCurrent HCExpected Output
Admin6/1/20211111
Admin7/1/20211122
Admin8/1/20211133
Admin9/1/20211144
FA6/1/20216969
FA7/1/202169138
FA8/1/202169207
FA9/1/202169276
Audit6/1/20219898
Audit7/1/202198196
Audit8/1/202198294
Audit9/1/202198392




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

Proud to be a Super User!





speedramps
Community Champion
Community Champion

Sorry I dont understand.

Please can you use the icon next to the [HTML] and copy and paste as a table rather than text,
and better explan the problem.

Thank you rajendraongole1 for the better example.

 

It looks like you want a running total by Department

 

When you produce a table visual it creates default filters for each row, in this case product and date.

 

So you need to use a command  to get the end date of your current row.

Then remove the date filter but keep the department filter.

Then sum the amount for all the dates up to and inclusing the end date.

 

Here are 2 solutions ....

 

 

Running Total =
VAR enddate = MAX(Facts[Date])
RETURN
CALCULATE(
SUM(Facts[Amount]),
REMOVEFILTERS(Facts[Date]),
Facts[Date] <= enddate
)
 
 
Running Total =
VAR enddate = MAX(Facts[Date])
RETURN
CALCULATE(
SUM(Facts[Amount]),
ALL(Facts[Date]),
Facts[Date] <= enddate
)
 

Remember we are BI community voluntrees so please click the thumbs-up for me taking the trouble to help you and then accept the solution if it works.  Thank you !

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.