Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hello Friend
I have tried everything i know by know to try come up with the Measure that can calculate Week to date (WTD) AVERAGE. Unfortunately all the help i found in my research does not work. I don't know why. I hope someone can take me out of this misery.
I provide a link to my data table
Basically I need Dynamic WEEK TO DATE (WTD) average based on date slicer for "Prod Quality (%)" in my data table (ProdData2). I have managed to get dynamic WTD sum for the "Prod Tonnes"
I will appreciate help Please!!
Kind regards
mramono
Solved! Go to Solution.
Hi @Mramono ,
Thank you for the update. I have created two measures WTD_Avg_Quality and WTD_NonZeroCount. Please refer below
1.
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
hello @Mramono
i assumed WTD is a running sum for a week.
please check if this accomodate your need.
1. create a new table for calendar date.
2. create a relationship between calendar and your fact table.
3. create a new measure with following DAX to calculate WTD for same week and year.
WTD =
SUMX(
FILTER(
ALL('Table'),
'Table'[Production Date]<=MAX('Calendar'[Date])&&
WEEKNUM('Table'[Production Date])=SELECTEDVALUE('Calendar'[Week])&&
YEAR('Table'[Production Date])=SELECTEDVALUE('Calendar'[Year])
),
'Table'[Prod Tonnes]
)
@Irwan thank you for the running sum, however i am mostly struggling with Running AVERAGE. Basically Running sum divided by number of rows in a running week (where the rows are non zeros and non blank)
I guess we need a dax that can COUNT ROWS that are non zero and non blank for the running week.
hello @Mramono
if you need running average, you can change SUMX into AVERAGEX.
if you need to exclude non-blank and zero value, then you can add more filter into the DAX.
Thank you.
Hi @Mramono ,
Thank you for reaching out to the Microsoft Community Forum.
As you mentioned in your previous post, you want a DAX measure that can COUNT ROWS that are non zero and non blank for the running week.
Please refer below DAX measure.
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
Hi @v-dineshya thank you very much for coming in to assist. Unfortunately i don't quite get the right answer. E.g. on the first week of the year in the my data, when i just use excel to get average for the first week the answer is 35.83 but in power bi on the script you graciously provided the answer is 33.02. I basically used a date slicer and chose 5th Jan, I assumed it will give me the average from the begining of the year to the 5th Jan.
Is it possible to make a separate measure that only count rows excluding zeros and blanks for Week to date?
Hi @Mramono ,
Thank you for the update. I have created two measures WTD_Avg_Quality and WTD_NonZeroCount. Please refer below
1.
I hope this information helps. Please do let us know if you have any further queries.
Regards,
Dinesh
Thank you so much @v-dineshya this works wonders, your dax code is doing exactly what i need.
Very much oblidged!!!
mramono
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.