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
syedsiraj10
Regular Visitor

Calculate average quarterly wise without considering current year data

I have a requirment to calculate average quartely wise data without considering current year data.

 

I have created a created a formuale to calculate the average , but its conisdering all the values.

Average For Quarters = DIVIDE(Query1[Column1],Query1[Quarter Calculation])

 

How we can exclude the current year values from the calculation. Similarly i need to calculate avergage monthly 

without considering current year data.

1 ACCEPTED SOLUTION

Thank for the reply @v-yuezhe-msft.

 

I was able to solve the problem by creating a variable 

Forecast = IF('Cash Flow'[FY_DC]='Cash Flow'[CurrentYear],0,'Cash Flow'[Average]).

 

My requirment was to show Average Quarterly wise across the years. For each quarter I had to show the forecast with Average() we will get the average for entire dataset in the visualization.

View solution in original post

3 REPLIES 3
v-yuezhe-msft
Employee
Employee

@syedsiraj10,

Do you get expected result when you create another measure using DAX below. You may need to create year column in the Query1 table.

Measurewithoutcurrentyear = CALCULATE([Average For Quarters], FILTER(Query1,Query1[Year]<YEAR(TODAY())))

There is also an example for your reference.
Measurewithoutcurrentyear = CALCULATE(SUM(Sheet5[SalesAmount]), FILTER(Sheet5,Sheet5[Year]<YEAR(TODAY())))
1.JPG

Regards,
Lydia

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

Thank for the reply @v-yuezhe-msft.

 

I was able to solve the problem by creating a variable 

Forecast = IF('Cash Flow'[FY_DC]='Cash Flow'[CurrentYear],0,'Cash Flow'[Average]).

 

My requirment was to show Average Quarterly wise across the years. For each quarter I had to show the forecast with Average() we will get the average for entire dataset in the visualization.

Greg_Deckler
Super User
Super User

Tough to say exactly without sample data but somewhere in your calculation you probably need to use a CALCULATE and FILTER to filter out the current year. [Year] = YEAR(TODAY())


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.