Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
yaman123
Post Patron
Post Patron

Past 12 Months Transfers

Hi all,  

 

I have the below measure but it is not producing the correct result. 

 

Measure 2 =

var x1= SELECTEDVALUE('Date'[Date].[MonthNo])

var x2=MAXX('Table',('Table'[FROM DATE].[MonthNo]))


return

IF(x2>=x1-12&&x2<=x1,1,0)
 
I would like to show all data from the chosen date and the previous 12 months. The measure is only showing me the month for last year.
 
E.g if i select Feb 2021, i would like to show all data previous 12 months. But the measure is showing me Feb 21 and Feb 20 data only. 
 
TIA 
 
Yasir
1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @yaman123 

 

It’s wrong to get the month like 'x2>=x1-12&&x2<=x1'. If you have a month slicer, and you want to filter data in table viusal, you can put the following measure in filter pane and set 1.

measure =
IF (
    DATEDIFF ( MAX ( 'Table'[FROM DATE] ), SELECTEDVALUE ( 'Date'[Date] ), MONTH ) <= 12,
    1,
    0
)

If it doesn’t solve your problem, please share some sample data and your desired result ,and feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-janeyg-msft
Community Support
Community Support

Hi, @yaman123 

 

It’s wrong to get the month like 'x2>=x1-12&&x2<=x1'. If you have a month slicer, and you want to filter data in table viusal, you can put the following measure in filter pane and set 1.

measure =
IF (
    DATEDIFF ( MAX ( 'Table'[FROM DATE] ), SELECTEDVALUE ( 'Date'[Date] ), MONTH ) <= 12,
    1,
    0
)

If it doesn’t solve your problem, please share some sample data and your desired result ,and feel free to ask me.

 

Best Regards

Janey Guo

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, 

 

Thanks for that. I think that gives me what i require 

 

 

amitchandak
Super User
Super User

@yaman123 , refer to my video on the same topic if that can help

https://www.youtube.com/watch?v=44fGGmg9fHI

Hi, 

 

That doesnt help. 

 

I would like to show the past 12 months of transfers

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.