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
Likhitha
Helper IV
Helper IV

Doubt regarding calcuation w.r.to Lag

Hello All,

I'm having lag column w.r.to month which means if lag is 1 and current month selection is November then my lag month is October,if it is lag 2 then lag month is september...the logic is like this.
And I'm having sales(%) for all months and if I select any lag and month(ex:october month and lag 2)
On graph i want to project lag month (August month sales (%)) on graph
How to achieve this??(Lag selection is dynamic)
IMG_20191202_151754.jpg
 
 
 
 
 
 
 
1 ACCEPTED SOLUTION
v-xuding-msft
Community Support
Community Support

Hi @Likhitha ,

I created a sample. Please try and check if it is what you want.

  • Create a measure

 

Measure = 
var a = CALCULATE(SUM('Table'[Sales]),FILTER('Table','Table'[Month] = MONTH(TODAY()) - 'Lag'[Lag selection]))
return
IF(ISFILTERED('Lag'[Lag]),a,SUM('Table'[Sales]))

 

2.PNG

Best Regards,

Xue Ding

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

Best Regards,
Xue Ding
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

1 REPLY 1
v-xuding-msft
Community Support
Community Support

Hi @Likhitha ,

I created a sample. Please try and check if it is what you want.

  • Create a measure

 

Measure = 
var a = CALCULATE(SUM('Table'[Sales]),FILTER('Table','Table'[Month] = MONTH(TODAY()) - 'Lag'[Lag selection]))
return
IF(ISFILTERED('Lag'[Lag]),a,SUM('Table'[Sales]))

 

2.PNG

Best Regards,

Xue Ding

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

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

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.