This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi,
What would the pattern of a visual calculation measure in a scenario where there is a hierarchy of Year and then Work type in the row labels of a matrix visual. The objective is to know the amount earned from the same work type in the earlier prior. Please see expected result column.
| Amount | Expected result | |
| 2025-26 | 12 | 57 |
| Work A | 12 | 23 |
| 2024-25 | 57 | 77 |
| Work A | 23 | 21 |
| Work B | 34 | 56 |
| 2019-20 | 77 | |
| Work A | 21 | |
| Work B | 56 |
Solved! Go to Solution.
Hi @Ashish_Mathur ,
Still working out the use case for the visual calculations but since it's based on the line values and is not like excel exactly I have created the following calculations:
Previous Year (support) = NEXT([Year])
Previous Year = IF([Previous Year (support)] = [Year],NEXT( [Previous Year (support)]), [Previous Year (support)])
Value =
IF(
ISINSCOPE([Work]),
LOOKUP([Sum of Amoount], [Work], [Work], [Year], [Previous Year]) ,
LOOKUP([Sum of Amoount], [Year], [Previous Year])
)
Then hide the Previous Year columns
Hope this helps you get started, has I said still trying some things and we can do more complex calculations for sure but this simple approach works.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Ashish_Mathur ,
Still working out the use case for the visual calculations but since it's based on the line values and is not like excel exactly I have created the following calculations:
Previous Year (support) = NEXT([Year])
Previous Year = IF([Previous Year (support)] = [Year],NEXT( [Previous Year (support)]), [Previous Year (support)])
Value =
IF(
ISINSCOPE([Work]),
LOOKUP([Sum of Amoount], [Work], [Work], [Year], [Previous Year]) ,
LOOKUP([Sum of Amoount], [Year], [Previous Year])
)
Then hide the Previous Year columns
Hope this helps you get started, has I said still trying some things and we can do more complex calculations for sure but this simple approach works.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThank you for your help @MFelix
Thank you for replying. I need to do this using visual calculations (not measures).
Expected Result Logic:
For each Work Type and Year in the matrix, return the Amount from the same Work Type in the previous Year.
DAX Pattern Summary:
Expected Result =
CALCULATE(
[Amount],
FILTER(
ALL('DateTable'),
'DateTable'[Year] = SELECTEDVALUE('DateTable'[Year]) - 1
),
FILTER(
ALL('Work'),
'Work'[Work Type] = SELECTEDVALUE('Work'[Work Type])
)
)
This works best in a matrix with Year and Work Type in rows
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 31 | |
| 26 | |
| 23 | |
| 22 | |
| 15 |
| User | Count |
|---|---|
| 62 | |
| 47 | |
| 28 | |
| 24 | |
| 20 |