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
MeeraD
New Member

How to calculate average based on month selected from different Years

I have 2 table dates and Transactions

date table has data (all days and months)

YearMOnthdateReportYear
2018jan01/01/2018Previous year
2018jan02/01/2018Previous year
2018feb Previous Year
2019Jan Current Year
2019feb Current Year

Now I have transaction Table

YearStreamHour
2018a10
2018a20
2019a30
2019a40

Both the table are joined on Year column

Now i have 2 slicer 

  • Month
  • Report Year

and a table which shows

Streamtotal Hours
  •  Previous year hours = 30. 
  • Selected months = Jan
  • total hour= Monthly average  = 30/12 x 1
When multiple FYs is selected:
  •  current Year hour= 30 
  • Previous year = 70
  • Selected months = Jan 2018+Jan 2019+Feb 2019 = 3 months
  • Total hours = (30/12) x 1 + (70/12) x 2
0 REPLIES 0

Helpful resources

Announcements
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.