cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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)

1 ACCEPTED SOLUTION
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]))``````

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.
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]))``````

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.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors