Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Generally the price = revenue / unit and there's an additional condition: if there is no revenue or units for a particular month, then the price should be null, and we will use the price from the master data instead for that month.
Product B in the image: when choosing January, since we do not have both revenue and units, the price retrieved from the master data is 7. When selecting February, the price is calculated as 30/5 = 6. Therefore, when selecting January and February, the price of Product B would be 6.5.
So, Is there any way to apply a condition per month for the price first, and then calculate the average for multiple months?
Thank you in advance!
Hi @XuanHau ,
I create three tables as you mentioned.
Then I create a measure and you will get what you need.
Average =
DIVIDE ( ( SUM ( Jan[Price] ) + SUM ( Feb[Price] ) ), 2 )
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The table for January, February, and the sum of January and February is a detailed table that I need to display on the report with data corresponding to the selected month/year slicer. It is not fixed fact table data, so I cannot use your suggestion
Thank you for your help!
User | Count |
---|---|
97 | |
85 | |
77 | |
66 | |
62 |
User | Count |
---|---|
110 | |
95 | |
95 | |
64 | |
58 |