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 August 31st. Request your voucher.

Reply
Roseventura
Responsive Resident
Responsive Resident

Need to calculate sum based on ALL dates up to and including Month selected from slicer

Hi,

 

I have a slicer for the Month name.  When a user selects the month from the slicer, I need to calculate Backlog for not only that month, but all backlog <= the last date of the month selected unless you select current month so it would be MTD in that case.

 

Example:  In the example below, November is selected.  So I need the table to display ALL backup up to and including the current date in November (11/14/22).  Currently it is showing me backlog ONLY for November (all years).

Screenshot 2022-11-14 120219.jpg

 

If a user chooses October, the last fiscal day of the month is 10/29.  I need the user to see ALL backup up to and including 10/29/22.  In this picture, the table is displaying ONLY October Backlog (all years).  I don't want it to go beyond 10/29/2022 and I need to see everything UP TO 10/29/22.

Screenshot 2022-11-14 120257.jpg

 

NOTE:  I use a 445 custom date calendar so DAX date functions DO NOT work for me.  My month name is directly tied to the FISCAL month, so if a user selects August from the slicer the fiscal dates in August are 7/31/2022 to 8/27/2022.

 

I'm using this measure to get the last fiscal day in the month selected:

 

Last Fiscal DiM =
VAR SelYear = SELECTEDVALUE(Dates[PADFYR], year(today()) )
VAR SelMonth = SELECTEDVALUE(Dates[PADFMO], month(today()) )
VAR GetLastDiM = calculate(Maxx(Dates, [paddate]), filter(Dates, Dates[padfyr] <= SelYear && Dates[PADFMO] <= Selmonth) )
return
    if( isblank(GetLastDiM) || SelMonth = month(today()), today(), GetLastDiM )
 
I'm using this measure to calculate all allocated backlog for dates up to an including the selected date:
 
Total Backlog Allocated to Date =
CALCULATE(
        [Total Backlog Allocated $$] ,
            all(Dates ),
                filter(Backlog, Backlog[Customer Request Date] <= [Last Fiscal DiM]) )
 
In plain English I need the above measure to give me all backlog where the Customer Request Date is <= the Last Fiscal DiM selected (example November 14, 2022).  I thought using ALL(DATES) would cause my Allocated measure to ignore all dates and just use the value of the date that results from the Last Fiscal DiM measure, but that is not working.  (Is it because the Last Fiscal DiM measure DOESN'T ignmore the Date filtering?)
 
Any help would be greatly appreciated!
 
 
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Roseventura You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...

 

This may also help: (3) Better Year to Date Total - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Roseventura You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...

 

This may also help: (3) Better Year to Date Total - Microsoft Power BI Community



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Your articles, while interesting did NOT solve my problem.  This seems to be a simple problem with DAX, not with my Date calendar.  

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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.