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
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
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.