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
Anonymous
Not applicable

Moving average of a full month

Hi everyone,

 

At the moment i have a problem with my moving average. 

BramKruiswijk_1-1620629977304.png

As you can see in the picture the moving average drops, because it count the month May. But the month May isn't over yet so it shouldn't be included in the moving average, because it gives a wrong image of the moving average. So i want to exclude the month we are in. I used the automatic formula that power bi provides;

BramKruiswijk_2-1620630202753.png

Is there a way to exlude the current month in the moving average so it gives a right image of the moving average in three months?

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , in the last calculate, move all into a filter

and try like

filter(all(Kalendar]) , Kalendar[date]<=emonth(today(),-1)

View solution in original post

You've missed out the closing bracket for ALL function:

FILTER(ALL(Kalender)

 

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , in the last calculate, move all into a filter

and try like

filter(all(Kalendar]) , Kalendar[date]<=emonth(today(),-1)

Anonymous
Not applicable

Hi @amitchandak 

 

when i try to put in your exact part of the formula it gives a error ( is assume emonth =eomont because i cant find a dax with emont). First i copied your part:

FILTER(ALL(Kalender,Kalender[Datum]<=EOMONTH(TODAY(),-1)
but this give me a error that says ; The function Filter must have at least 2 arguments.

So i tried to fix this with this:
BramKruiswijk_1-1620639397085.png

But then it gives a error at <=

and when i removed <= out of the formula:

FILTER(ALL(Kalender,Kalender[Datum]),EOMONTH(TODAY(),-1)
it says the following error: multiple table arguments are not allowed in the ALL/ ALLNOBLANK/REMOVEFILTERS function.

 

Any ideas how to solve this? thank you

 

You've missed out the closing bracket for ALL function:

FILTER(ALL(Kalender)

 

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.