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
paglioz3
New Member

problem with total progressive

Hi all,

I need to calculate a progressive value in base of the period filtered by user, from older to laster, but the result sum start from the last date. I use the script:

 

progressive_value=
VAR MinDate = MIN ( 'CALENDAR'[Date] ) -- Saves the last visible date
RETURN CALCULATE ([value], 'CALENDAR'[Date] >= MinDate )
 
And this is the actual result:

datevalueprogressive_value
nov-19334838393
dic-19467835045
gen-20356630367
feb-20302026801
mar-20170423781
apr-201065222077
mag-20145711425
giu-2015569968
lug-2039878412
ago-2036974426
set-20729729


Any suggestion?

1 ACCEPTED SOLUTION

Hi  @paglioz3 ,

 

Try below expression:

progressive_value =
VAR MinDate =
MINX ( ALLSELECTED ( 'CALENDAR'),'CALENDAR'[Date] ) -- Saves the last visible date
RETURN
CALCULATE ( [value], 'CALENDAR'[Date] >= MinDate )

 

 

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

4 REPLIES 4
vanessafvg
Super User
Super User

you mean like this?

progressive_value =
VAR MinDate =
MIN ( ALLSELECTED ( 'CALENDAR'[Date] ) ) -- Saves the last visible date
RETURN
CALCULATE ( [value], 'CALENDAR'[Date] >= MinDate )




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Thank's but no, with ALLSELECTED funtion returned an error (

the MIN function accepts only a column reference as an argument
)

for completeness, the measure [value] = calculate(sum([import]))

Hi  @paglioz3 ,

 

Try below expression:

progressive_value =
VAR MinDate =
MINX ( ALLSELECTED ( 'CALENDAR'),'CALENDAR'[Date] ) -- Saves the last visible date
RETURN
CALCULATE ( [value], 'CALENDAR'[Date] >= MinDate )

 

 

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Thanks!

Below the complete code:

 
progressive_value =
VAR MinDate = MINX ( ALLSELECTED ( 'CALENDAR'),'CALENDAR'[Date] ) -- Saves the last visible date
var MaxDate = MAX ('IND'[Date])
var Value= CALCULATE (IND[Amount])
RETURN
CALCULATE ( Value, 'CALENDAR'[Date] >= MinDate, 'CALENDAR'[Date] <= MaxDate )

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.