cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
andreasalleslev
Helper I
Helper I

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
Resident Rockstar
Resident Rockstar

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✌️!!

 

View solution in original post

Thank you som much - Is exacly what i want.

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!