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
AkrMus
Helper I
Helper I

Different Periods Average in Power BI

Here is my data

Finance

enter image description here

I have chart that display monthly data

Like this

enter image description here

I need to do average for periods that are specified in another table.

Periods

enter image description here

So the end results should look like this

enter image description here

I know it should be a New Measure, but not sure how to write the DAX for that measure to do this averaging

I tried and ended with this, but it is not working

CALCULATE (
Average(Finance[Result]),
FILTER (
ALL ( Periods),
DATE ( Finance[Year], Finance[Month], 1 ) >= Periods[FromDate] 
&&  DATE ( Finance[Year], Finance[Month], 1 ) < Periods[ToDate]
)
)

but this is does not work

Anyone know how to build the measure dax to do this?

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@AkrMus 

 

You may add a calculated column first.

https://community.powerbi.com/t5/Desktop/conditional-join/m-p/340423#M152404

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

View solution in original post

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@AkrMus 

 

You may add a calculated column first.

https://community.powerbi.com/t5/Desktop/conditional-join/m-p/340423#M152404

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

Hi @AkrMus ,

 

Please share your data with tables instead of pictures. Or if possible please share your .pbix file.


Please see this post regarding How to Get Your Question Answered Quickly:

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Cheers,
Rob

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.