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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply

How to sum all up to selected max date

Hallo

 

Can someone help me to create af measure that sum all post from first date to the max selected date in slicer.

 

This measure works (ofcauce)

 

Saldo = CALCULATE(SUM(NavPosteringer[Beløb]),
ALL(Datetable[Date]),
NavPosteringer[Bogføringsdato] <= DATE(2021, 08, 31))
 
but when i change to:
Saldo = CALCULATE(SUM(NavPosteringer[Beløb]),
ALL(Datetable[Date]),
NavPosteringer[Bogføringsdato] <= MAX(Datetable[Date])) 


is dosent work.
How can i do it??
 
Best regards Andreas
1 ACCEPTED SOLUTION

Did you select any date on the slicer?

Try this:

Saldo2 = CALCULATE(SUM(NavPosteringer[Beløb]), FILTER(ALL(NavPosteringer[Bogføringsdato]),NavPosteringer[Bogføringsdato] <= SELECTEDVALUE(Datetable[Date],MAX(Datetable[Date]))))

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos✌️!!

 

View solution in original post

6 REPLIES 6
VahidDM
Super User
Super User

Hi @andreasalleslev 

 

You need to use the  SELECTEDVALUE dax code.

Try this:

Saldo = CALCULATE(SUM(NavPosteringer[Beløb]),
ALL(Datetable[Date]),
NavPosteringer[Bogføringsdato] <= SELECTEDVALUE(Datetable[Date])) 
 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos✌️!!

 
 

Hallo

Thank you, but i get a error:

 

andreasalleslev_0-1631786247021.png

Hmm?? have you any idea??

@andreasalleslev 

That is because you need to use that in filter.

try this:

Saldo = CALCULATE(SUM(NavPosteringer[Beløb]),
Filter(ALL(Datetable[Date]),NavPosteringer[Bogføringsdato] <= SELECTEDVALUE(Datetable[Date])))
 
 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos🙏!!

Okay - now I not got a error, but is dont calculate.

 

Saldo2 = CALCULATE(SUM(NavPosteringer[Beløb]), FILTER(ALL(NavPosteringer[Bogføringsdato]),NavPosteringer[Bogføringsdato] <= SELECTEDVALUE(Datetable[Date])))
 
the saldo2 is blank. 

Did you select any date on the slicer?

Try this:

Saldo2 = CALCULATE(SUM(NavPosteringer[Beløb]), FILTER(ALL(NavPosteringer[Bogføringsdato]),NavPosteringer[Bogføringsdato] <= SELECTEDVALUE(Datetable[Date],MAX(Datetable[Date]))))

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos✌️!!

 

Thank you som much - Is exacly what i want.

Helpful resources

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

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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