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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello guys I need these calculation to work for a card visual to display the value of sum auditfile
Solved! Go to Solution.
Hi @Anonymous
you can manually insert a single column table that contains the years. Let's call it 'YearFilter' which will be completely disconnected from any other table in your data model. This table will be used as a slicer and the measure would be
SumMeaaure =
VAR CurrentYear =
SELECTEDVALUE ( 'YearFilter'[Year] )
RETURN
CALCULATE (
SUM ( '2 (Auditfile)'[saldo] ),
'2 (Auditfile)'[fiscalYear] >= CurrentYear - 1
)
Hello why not use previous year?
Calculate(sum(tabble[value]),previousyear([date]))
becasue that doesnt work for me the way my data is build :(:(:( it would be the easy way i know but i have the bad luck i have to fix a working repot :S
Hmm well when you select a slicer the range becomes only for the slicer so try the removefilters function?
CALCULATE(SUM('2 (Auditfile)'[saldo]), IF(VALUES('2 (Auditfile)'[fiscalYear])>2018,[fiscalyear]-1),removefilters(dateyouuseforslicer))
if i use your formule i get this error
Hi @Anonymous
would you please explain what are you trying to achieve by the IF statement in your DAX code?
Hey tamerj1
i'm trying to archieve a calculation in a card visual, if i select 2019 in a slicer i want the sum of saldo from 2018
if i select 2020 in a slicer i want the sum of saldo from 2019 and so on
i know the if statement works for -1 on the year
Hi @Anonymous
you can manually insert a single column table that contains the years. Let's call it 'YearFilter' which will be completely disconnected from any other table in your data model. This table will be used as a slicer and the measure would be
SumMeaaure =
VAR CurrentYear =
SELECTEDVALUE ( 'YearFilter'[Year] )
RETURN
CALCULATE (
SUM ( '2 (Auditfile)'[saldo] ),
'2 (Auditfile)'[fiscalYear] >= CurrentYear - 1
)