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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
NPH2020
Regular Visitor

Monthly averages issue

Hi all

 

I have a problem with monthly averages :

 

My underlying data is rolled up at a monthly level but one key parameter is the average daily volume.  This is calculated on a workday basis subject to bespoke holidays so I have this in a separate table.  I can easily define a a calcualted column to create the averages and this works to display the data correctly on a monthly basis but i need to be able to show the averages over quarters and years.

 

I have failed in linking the related number of workdays in the separate table while still calcuating the separate averages.  My aim is for this as a dynamic mneasure :

 

Sum of attribute / sum of period workdays (from related table)

 

Any guidance appreciated.

 

THanks !

5 REPLIES 5
amitchandak
Super User
Super User

@NPH2020 Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

if you have a common date table for both, you should be able to analyze these across month ,qtr and year.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi

 

Datasets as per below :

 

Table 1  
   
EOMattributeValue
31-JanA118
31-JanB50
31-JanC62
31-JanD173
28-FebA179
28-FebB153
28-FebC27
31-MarB92
31-MarC40
31-MarD39
30-AprA16
30-AprB191
30-AprC12
30-AprD42
30-AprE35
31-MayB152
31-MayC190
31-MayD158
31-MayE191
30-JunA93
30-JunB61
30-JunC158
30-JunD53
30-JunE118

 

Table 2 
  
EOMWork day
31-Jan18
28-Feb19
31-Mar22
30-Apr18
31-May16
30-Jun22
31-Jul20

 

Many thanks

@NPH2020 , Join to a common date table and there you can have a month, qtr and year.

 

You can create a measure like

Divide(Sum(Tabel1[Value]), sum(Table2[Work day]))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

See if my webinar on Time Intelligence can help: https://community.powerbi.com/t5/Webinars-and-Video-Gallery/PowerBI-Time-Intelligence-Calendar-WTD-Y...


Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi

 

Sadly as the mock up of the data didn't account for the fact that the attrubtes repeat in the months and so it is summing the numerator correctly but then dividing but multiple sums of the workdays, rather than one.  I have tried the "distinct" function and it does not like that in sum functions, nor does it allow me to sum related columns.  It works as a calculated column, but then the aggregation doesn't.

 

sorry for the original dataset issue....

@NPH2020 , Try

 

Divide(Sum(Tabel1[Value]), sumX(Summarize(Table2, Table2[EOM],"_1" ,max(Table2[Work day])),[_1]))

 

 

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.