Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have YTD and last year YTD in different columns and how can I see YTD value for 2017 and 2018 when the year 2018 is selected in a year slicer?
Solved! Go to Solution.
Hi @Anonymous,
It seems like your records are in same table, maybe you can use 'all' function to replace 'all selected' to break current filter effect to let formula calculate on whole table:
Utfall YTDLY = CALCULATE ( SUM ( 'Transaktion'[konto] ), FILTER ( ALL( 'Transaktion' ), [Datum] >= DATE ( YEAR ( TODAY () ) - 1, 1, 1 ) && [Datum] <= ( DATE ( YEAR ( TODAY () ) - 1, MONTH ( TODAY () ), 1 ) - 1 ) ) )
Regards,
Xiaoxin Sheng
Hi @Anonymous,
You can use date and YTD columns to create table visual, then write a measure to look up last year YTD column and add it to current visual.
Share some data if you confused on coding formula.
Regards,
Xiaoxin Sheng
I want to get YTD values from January till the end of last month so I used the following formula to create a measure for YTD and YTD LY
Utfall YTD = CALCULATE(SUM('Transaktion'[konto]),FILTER('Transaktion',[Datum]>=DATE(YEAR(TODAY()),1,1) && [Datum] <=(DATE(YEAR(TODAY()),MONTH(TODAY()),1)-1)))
Utfall YTD LY= CALCULATE(SUM('Transaktion'[konto]),FILTER('Transaktion',[Datum]>=DATE(YEAR(TODAY())-1,1,1) && [Datum] <=(DATE(YEAR(TODAY())-1,MONTH(TODAY()),1)-1)))
hI @Anonymous,
I'd like to suggest you use allselected function to filter use filtered table contents to calculate with your measure formula:
Utfall YTD = CALCULATE ( SUM ( 'Transaktion'[konto] ), FILTER ( ALLSELECTED ( 'Transaktion' ), [Datum] >= DATE ( YEAR ( TODAY () ), 1, 1 ) && [Datum] <= ( DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 ) - 1 ) ) ) Utfall YTDLY = CALCULATE ( SUM ( 'Transaktion'[konto] ), FILTER ( ALLSELECTED ( 'Transaktion' ), [Datum] >= DATE ( YEAR ( TODAY () ) - 1, 1, 1 ) && [Datum] <= ( DATE ( YEAR ( TODAY () ) - 1, MONTH ( TODAY () ), 1 ) - 1 ) ) )
Regards,
Xiaoxin Sheng
@v-shex-msftThank you, but it still shows me the same problem.
when the year 2018 is selected YTD LY doesn't appear.
below is my sample file
Hi @Anonymous,
It seems like your records are in same table, maybe you can use 'all' function to replace 'all selected' to break current filter effect to let formula calculate on whole table:
Utfall YTDLY = CALCULATE ( SUM ( 'Transaktion'[konto] ), FILTER ( ALL( 'Transaktion' ), [Datum] >= DATE ( YEAR ( TODAY () ) - 1, 1, 1 ) && [Datum] <= ( DATE ( YEAR ( TODAY () ) - 1, MONTH ( TODAY () ), 1 ) - 1 ) ) )
Regards,
Xiaoxin Sheng
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |