Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
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
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
20 | |
14 | |
11 | |
10 | |
8 |