Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I calculated weighted average of the cost using "Quick measure" in Power BI:
I need to calculate weighted average within a six month date range (for example, if the bid dates of the project are between 5/1/2023 and 10/1/2023). How would i modify the weighted avg formula or should i create new column? If so, please help with DAX. Thank you.
Solved! Go to Solution.
Hi @PC2022 ,
You can create a measure as below to get it:
Weighted Average 6 Months =
CALCULATE (
SUMX (
FILTER (
'Test Full Pay Items',
'Test Full Pay Items'[Bid Date] >= DATE ( 2023, 5, 1 )
&& 'Test Full Pay Items'[Bid Date] <= DATE ( 2023, 10, 1 )
),
'Test Full Pay Items'[Highest Bid] * 'Test Full Pay Items'[Qty]
)
/ SUMX (
FILTER (
'Test Full Pay Items',
'Test Full Pay Items'[Bid Date] >= DATE ( 2023, 5, 1 )
&& 'Test Full Pay Items'[Bid Date] <= DATE ( 2023, 10, 1 )
),
'Test Full Pay Items'[Qty]
)
)
If the above one can't help you get the expected result, please provide some raw data in your tables (exclude sensitive data) with Text format and your visual settings. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @PC2022 ,
You can create a measure as below to get it:
Weighted Average 6 Months =
CALCULATE (
SUMX (
FILTER (
'Test Full Pay Items',
'Test Full Pay Items'[Bid Date] >= DATE ( 2023, 5, 1 )
&& 'Test Full Pay Items'[Bid Date] <= DATE ( 2023, 10, 1 )
),
'Test Full Pay Items'[Highest Bid] * 'Test Full Pay Items'[Qty]
)
/ SUMX (
FILTER (
'Test Full Pay Items',
'Test Full Pay Items'[Bid Date] >= DATE ( 2023, 5, 1 )
&& 'Test Full Pay Items'[Bid Date] <= DATE ( 2023, 10, 1 )
),
'Test Full Pay Items'[Qty]
)
)
If the above one can't help you get the expected result, please provide some raw data in your tables (exclude sensitive data) with Text format and your visual settings. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |