Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I have a measure which uses
=-CALCULATE (
SUM ( Budget[Budget Data] ),
FILTER ( ALL ( 'Sagecalcodes' ), INT('Sagecalcodes'[Year]) = YEAR(TODAY())
))This only gives me 2017, so if someone goes back to 2016 it still shows 2017, how would I get what date is on the filter into DAX.
Thanks
Solved! Go to Solution.
Hi @Anonymous,
Could you try the formula below to see if it works in your scenario?![]()
=
VAR currentSelectedYear =
MAX ( 'Sagecalcodes'[Year] )
RETURN
- CALCULATE (
SUM ( Budget[Budget Data] ),
FILTER (
ALL ( 'Sagecalcodes' ),
INT ( 'Sagecalcodes'[Year] ) = currentSelectedYear
)
)
Regards
Hi @Anonymous
the beauty is: you dont have to, it's all been taken care of as soon as you add a second visual to the page (a slicer) and put the
'Sagecalcodes'[Year]
Column on it,
remove the entire filter expression from your measure code, you dont need it 🙂
HTH,
Frank
Thanks Frank, sorry should have explained it better. I am trying to create a Profit and Loss matrix
I have two slicers on the screen one is
'Sagecalcodes'[Year]
the other is
'Sagecalcodes'[Months]
I am wanting to have it in the same table. Due one of slicers being Months I need to add my own filter measure, any idea how to do that?
TIA
Hi @Anonymous,
Could you try the formula below to see if it works in your scenario?![]()
=
VAR currentSelectedYear =
MAX ( 'Sagecalcodes'[Year] )
RETURN
- CALCULATE (
SUM ( Budget[Budget Data] ),
FILTER (
ALL ( 'Sagecalcodes' ),
INT ( 'Sagecalcodes'[Year] ) = currentSelectedYear
)
)
Regards
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 46 | |
| 42 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 192 | |
| 125 | |
| 99 | |
| 67 | |
| 48 |