Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I need help to show the difference of a measure between different Dates.
I already tried this here Difference between two columns or rows , but this doesn't work with measures only with tables.
Hope that someone can help me here.
Solved! Go to Solution.
Please try again.
DEF = [Average PP]-CALCULATE([Average PP], SAMEPERIODLASTYEAR('Calendar'[Date]))
Did you make a calendar table?
How about this formula?
DEF = [Average PP]-CALCULATE([Average PP], PREVIOUSYEAR('Calendar'[Date]))
Hello mickey64,
I had overlooked that you had adjusted your formula in your last post and this one works beautifully. Thank you very much you have helped me a lot.
For your reference.
Step 1: I make calendar table and add relationship.
Step 2: I make a mesure below.
DEF = SUM([Average PP])-CALCULATE(SUM([Average PP]),SAMEPERIODLASTYEAR('Calendar'[Date]))
Thank you mickey64,
but unfortunately this doesn't work. Average APP is already a measure and it does not let me use the measure in this formular. I tried to implement the formular of the measure instead, but this doesn't work. This is the formular used in the measure:
Please try again.
DEF = [Average PP]-CALCULATE([Average PP], SAMEPERIODLASTYEAR('Calendar'[Date]))
Did you make a calendar table?
Hi mickey64,
now I was too hasty. Unfortunately, your formula does not work. It does calculate, but the result is not correct, but now I do not know why that is. Sometimes it is at least close but then sometimes completely off.
If you could paste the data you are using for aggregation in text format, I might be able to figure out the cause.
Or, do you show me the model view?
Hi mickey64
I got the solution, thanks to your formular, I also have the average price
from last year for the same periode, so I do not need my average, I just take yours. Problem solved. Thank you!!
Hi mickey64,
I found out where the problem is and it was actually staring at me the whole time. The problem is, to calculate the average purchase price, I just divide by the quantity and then I get an average price for the entire current year and the entire past year, but with your formula it uses the difference of the same period as the current year, so only from January to September and that then leads to the different result because my average includes, the entire past year.
So either we find a way to calculate the average price over the same period length, or there is a way to calculate the difference over the whole past year, but I think it would be more correct with matching period. But either way is fine with me. Do you have a solution for this?
How about this formula?
DEF = [Average PP]-CALCULATE([Average PP], PREVIOUSYEAR('Calendar'[Date]))
Thank you so much. I see there is so much for me to learn so that hopefully in the future I will despair more of the challenging theme.
Yes I made a calendar table, I had it before. But I don't even get that far in the input, because I can't even enter the Measure Average PP into the formula. The formula only allows tables but no measures.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
88 | |
82 | |
65 | |
64 | |
58 |
User | Count |
---|---|
171 | |
115 | |
109 | |
74 | |
69 |