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
Misha
Helper II
Helper II

Moving Average + Periods on the visual

Hi everyone,

 

It must be a pretty common problem but I m struggling with it and can't find the solution. I ve created a quick measure measuring the moving average (last 12 months) but when I use it in a visual my last date shown in the visual isn't "today" but "today+12mnths"... When I restrict the date dynamically my input isn't correct anymore... Anyone that can help me to fix that please? Thanks in advance!PBI.jpgPBI_230820(2).docx.jpg

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hi @Misha ,

Where X axis in the visual is from? It is from the date field of Calendar table? If yes, what's the date range in Calendar table? By the way, whether your measure "VS_Gemidd_Off_TOT" can return the correct values except the date problem?

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Tx @v-yiruan-msft for your reply. On the X-axis a date field yes, the return of my data is correct untill the current date as i ve explained on my reply to Fowmy

Fowmy
Super User
Super User

@Misha 

You can include  you entire measure inside and IF condition like

IF(
 NOT ISBLANK (COUNTA(TABLE[COLUMN)) , 

 YOUR MEASURE
)


________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Tx for your reply @Fowmy  but this seems to have no single effect on the visual... The formula seems to work right but my visual  and the result is correct but only untill the current date so i want to have my visual cut off on the current date without effects on the counting in the formula. I Try to explain: I want to have a Rolling Average  where the result on today = the average of the past 12 months. So I created the above mentioned quick measure so far so good. But...in my visual, all futrure months are also shown and that until Current month + 12.  The formula counts the months in the future as 'zero' so the result of future months is not relevant. When i filter my date-range to all past dates (excluding the future) the formula provides me other (wrong) results. So i thought to have a solution by cutting the shown period of the visual on the current date.

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.