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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Patrick_Murphy
Frequent Visitor

Sum of all previous amounts up to the end of the selected period

Hi everyone,

 

i am trying to find a way to sum all previous amounts up to the end of the selected fiscal year or fiscal quarter.

 

In the examples below, i tried to reproduce what i'm trying to do.

 

I have a date table with fiscal years and quarters that is linked to my fact table that contains the net amounts i want to sum.

I want to filter the data in my report to show the current years data but for this measure, i would like it to sum all the past entries up to the end of the selected year in the slicer.

 

So, 2023 would sum up all past entries right up to the end of the 2023.

2024, all past entries up to the end of 2024, and so on.

 

Patrick_Murphy_0-1715718167072.png

 

There is probably an easy solution for this but i'm not a DAX expert. So any help would be greatly appreciated.

Thanks.

2 REPLIES 2
ExcelMonke
Responsive Resident
Responsive Resident

Hello, 

Consider the following measure: 

natAmountTD = 
VAR _MinDate = [your min date here]
VAR _MaxDate = SELECTEDVALUE(DateTable[FiscalYear])

RETURN
CALCULATE(SUM(FactTable[natAmount]),DATESBETWEEN(DateTable[FiscalYear],_MinDate,_MaxDate))

Thanks for the reply !

 

I tried this but it doesn't work since my fiscal year isn't a date, it's a text ex: FY2024. So the DATESBETWEEN function doesn't accept it.

 

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.