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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rajendraongole1
Post Prodigy
Post Prodigy

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

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
Post Prodigy
Post Prodigy

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

rajendraongole1
Post Prodigy
Post Prodigy

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

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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