Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi! What formula can I apply to be able to compare the period 2019 with the period 2017 since with the measurement
Solved! Go to Solution.
Hi @luistiscornia ,
The SAMEPERIODLASTYEAR function needs to reference a date/time column. You can try the following measure:
comparativa =
CALCULATE(
[VOTOS TOTALES],
FILTER(
ALLSELECTED('Table'),
'Table'[Year] = MAXX(
FILTER(
ALLSELECTED('Table'),
'Table'[Year] < MAX('Table'[Year])
),
'Table'[Year]
)
)
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @luistiscornia ,
The SAMEPERIODLASTYEAR function needs to reference a date/time column. You can try the following measure:
comparativa =
CALCULATE(
[VOTOS TOTALES],
FILTER(
ALLSELECTED('Table'),
'Table'[Year] = MAXX(
FILTER(
ALLSELECTED('Table'),
'Table'[Year] < MAX('Table'[Year])
),
'Table'[Year]
)
)
)
If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@luistiscornia , You want to compare two values selected in the year box?
example
measure 1=
VAR minDate = MINX( allselected('Calendar') , 'Calendar'[Year] )
VAR maxDate = MAXX(allselected('Calendar') , 'Calendar'[Year] )
RETURN
CALCULATE([VOTOS TOTALES], filter('Calendar', 'Calendar'[Year] =_max)) - CALCULATE([VOTOS TOTALES], filter('Calendar', 'Calendar'[Year] =_min))
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 51 | |
| 40 | |
| 37 | |
| 14 | |
| 14 |
| User | Count |
|---|---|
| 85 | |
| 69 | |
| 38 | |
| 29 | |
| 27 |