Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi Team,
I have a measure which determines year-over-year unit growth as follows:
Solved! Go to Solution.
Hi @mibu ,
I did two things
1. I simplified you measure using a variable
2. I implemented a rule which provides ablank result when the previous year value is smaller than zero
Please try it out
UnitGrowth =
var PreviousYear_Value =
CALCULATE(
SUM(TableName[Units]),
DATEADD(DateTable[Day],-365,DAY)
)
RETURN
IF(
PreviousYear_Value > 0,
DIVIDE(
SUM(TableName[Units]) - PreviousYear_Value,
PreviousYear_Value
)
)
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
@Mikelytics Thanks so much for your reply! I appreciate learning the variable feature from the solution you provided. I can see it being very handy going forward. 🙂 Very best, mibu
Hi @mibu: ,
Awsome and thank you for your feedback! 🙂 I am happy to help!
Best regards
Michael
Hi @mibu ,
see my solution in the attached file.
https://1drv.ms/u/s!Aj45jbu0mDVJi1Pc5qgfG3xymY10?e=Y0x2tr
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@mangaus1111 Thank you for your reply! I see you used variable as well. I didn't get a chance to work it into my model but it looks very similar to @Mikelytics solution and imagine it would bear same good fruit. Again, thank you for your feedback... much appreciated! Very best, mibu
Hi @mibu ,
I did two things
1. I simplified you measure using a variable
2. I implemented a rule which provides ablank result when the previous year value is smaller than zero
Please try it out
UnitGrowth =
var PreviousYear_Value =
CALCULATE(
SUM(TableName[Units]),
DATEADD(DateTable[Day],-365,DAY)
)
RETURN
IF(
PreviousYear_Value > 0,
DIVIDE(
SUM(TableName[Units]) - PreviousYear_Value,
PreviousYear_Value
)
)
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
User | Count |
---|---|
131 | |
108 | |
101 | |
67 | |
64 |
User | Count |
---|---|
137 | |
115 | |
102 | |
71 | |
61 |