Forum Discussion
YOY CHANGE FOR FIRST YEAR
- 1 year ago
Hi zraopingm ,
Thank you for reaching out to the Microsoft Fabric Community forum.
Please follow below steps.
1. Created sample table (Table) with sample data.
2. Created Measure (Total Amount) with below DAX code.
Total Amount = SUM('Table'[TOTAL AMOUNT1])
3. Created visual calculation with below DAX code.
YOY CHANGE =
VAR PrevAmount =
CALCULATE(
[Total Amount],
OFFSET(-1, ORDERBY([Reporting Year]))
)
RETURN
IF(
ISBLANK(PrevAmount),
BLANK(),
[Total Amount] - PrevAmount
)4. Please refer output snap, sample data and attached PBIX file.
If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
Hi zraopingm ,
Thank you for reaching out to the Microsoft Fabric Community forum.
Please follow below steps.
1. Created sample table (Table) with sample data.
2. Created Measure (Total Amount) with below DAX code.
Total Amount = SUM('Table'[TOTAL AMOUNT1])
3. Created visual calculation with below DAX code.
YOY CHANGE =
VAR PrevAmount =
CALCULATE(
[Total Amount],
OFFSET(-1, ORDERBY([Reporting Year]))
)
RETURN
IF(
ISBLANK(PrevAmount),
BLANK(),
[Total Amount] - PrevAmount
)
4. Please refer output snap, sample data and attached PBIX file.
If this information is helpful, please “Accept it as a solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
- zraopingm1 year ago
Helper IV
it worked!!! and making sense and I learned a lot.
i have no clue i can use VAR in Visual cal. thank you thank you all!!!
have a great DAX day!!