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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.