Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I am having difficulties creating a measure which finds the average price per product by month.
I want to find a way to have DAX group by product, and then find the average price of which each of the products individually has been purchased during the whole month. The measure i have created simply returns the price per day, and does not account for the average of all prices. Please note i have a Filter active which filter for month (january in this case)
My measure is:
Solved! Go to Solution.
Hi,@Arlind_Selimaj.Hello, @amitchandak .Thank you very much for the help of the problem.
I am glad to help you.
How,I want share another solution of mine with you.
According to your description, you want to create a measure to calculate the average purchase amount for each product in the filtered month, given that the date filter already exists?
You can try the following DAX code:
Measure_ =
CALCULATE(
AVERAGE('Table'[Price per unit]),
FILTER(ALLSELECTED('Table'),'Table'[Product name]=MAX('Table'[Product name]))
)
Here is my test data:
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,@Arlind_Selimaj.Hello, @amitchandak .Thank you very much for the help of the problem.
I am glad to help you.
How,I want share another solution of mine with you.
According to your description, you want to create a measure to calculate the average purchase amount for each product in the filtered month, given that the date filter already exists?
You can try the following DAX code:
Measure_ =
CALCULATE(
AVERAGE('Table'[Price per unit]),
FILTER(ALLSELECTED('Table'),'Table'[Product name]=MAX('Table'[Product name]))
)
Here is my test data:
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Arlind_Selimaj , Try one of the two
AVERAGEX(
Values( '1.date[Month Year]'), calculate(Sum('All Product'[Price per unit]))
)
or
AVERAGEX(
Summarize('All Product', 'All Product'[Product] , '1.date[Month Year]'), calculate(Sum('All Product'[Price per unit]))
)
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
112 | |
102 | |
94 | |
38 | |
30 |