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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
dp32
Helper I
Helper I

Exception aggregation

Hi,

I have a Pivot Table with a P&L account hierarchy. For some of the accounts, I need an exceptional aggregation other than sum.
E.g. for the account Depreciation Tangibles, the MTD values should not sum up to a QTD and YTD total, but just show the value of the last month of the quarter (or year).

How can I do this in Power BI?

 

Thanks in advance!

4 REPLIES 4
Anonymous
Not applicable

Hi @dp32,

Perhaps you can take a look at the following blog about the hierarchy level, then you can use if statement with filter check current hierarchy level and replace it will specific formula.

Clever Hierarchy Handling in DAX 
Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

If you have date table you can do like

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] =maxx(date,date[date])))

Or

Cumm Sales = CALCULATE(SUM(Sales[Sales Amount]),filter(date,date[date] =maxx(date,endofmonth(dateadd(date[date]),-1,month))))

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks, but this will not result in an exception aggregation. It will then be applied to all accounts of the P&L hierarchy.

vivran22
Community Champion
Community Champion

Hello @dp32 

 

You can create measures using time intelligence functions like LASTDATE, CLOSINGBALANCEMONTH, CLOSINGBALANCEYEAR, CLOSINGBALANCEQUARTER, 

 

For this you would also need to create a calendar table.

 

Cheers!
Vivek

If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂

https://www.vivran.in/

Connect on LinkedIn

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.