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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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())


Follow on LinkedIn
@ 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.