Reply
HKteck
New Member
Partially syndicated - Outbound

division should be (by 6) adjusted accordingly

Hi,

Report link 

https://www.dropbox.com/scl/fi/14g838ufc6d6y9eankp3e/Data-2024-PBI.pbix?rlkey=9hpijshbqnaavroceyqnbr... 

 

In the daily view, data for the 6th is missing.

In the weekly view, the division by 7 is used to calculate averages, but when there is missing data for specific days, like on the 7th and 14th of January 2024, the division should be (by 6) adjusted accordingly. Instead of dividing by 7, it should only divide by the number of available days, which in these cases would be 6, since data is not available for the 6th and 13th of January 2024.

Kindly help how I can perform this calculation 

HKteck_0-1705385342216.png

@MDax @dax 

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

Syndicated - Outbound

Hi, @HKteck 
Based on the information you gave, I have created a table

 

Please follow these steps:

 

  1. Create a new measure and named  Available Days. We first count the number of available days, then use slicers or filters to filter the number of available days from Monday to Sunday, and finally calculate.

vyohuamsft_0-1705467875181.png

 

2.png

 

vyohuamsft_2-1705467875184.png

 

 

  1. Then use the following DAX expression.

 

Available Days = CALCULATE(

         DISTINCTCOUNT('Data 2024'[Date]),

         FILTER(ALLSELECTED('Data 2024'),'Data 2024'[Date]<=MAX('Data 2024'[Date])

         ))

 

Quantity Weekly = 'Data 2024'[Quantity]/'Data 2024'[Available Days]

 

 

 

 

How to Get Your Question Answered Quickly 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Yongkang Hua

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-yohua-msft
Community Support
Community Support

Syndicated - Outbound

Hi, @HKteck 
Based on the information you gave, I have created a table

 

Please follow these steps:

 

  1. Create a new measure and named  Available Days. We first count the number of available days, then use slicers or filters to filter the number of available days from Monday to Sunday, and finally calculate.

vyohuamsft_0-1705467875181.png

 

2.png

 

vyohuamsft_2-1705467875184.png

 

 

  1. Then use the following DAX expression.

 

Available Days = CALCULATE(

         DISTINCTCOUNT('Data 2024'[Date]),

         FILTER(ALLSELECTED('Data 2024'),'Data 2024'[Date]<=MAX('Data 2024'[Date])

         ))

 

Quantity Weekly = 'Data 2024'[Quantity]/'Data 2024'[Available Days]

 

 

 

 

How to Get Your Question Answered Quickly 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

Syndicated - Outbound

@HKteck , Assume you already have a measure M1 and using the date table and date and week coming on axis from the date table 

 

You can use measure like

 

Averagex(Values(Date[Date]), [M1])

 

In this it will take only 6 days avg it data is available for 6 days of week

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)