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

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.

Reply
Retrorock
Frequent Visitor

MTD from last year without any time intelligence (if possible)

So our group has been tasked to create a MTD and Last Year MTD column base on a set of data we have been given.

For some reason these data doesn't come with dates but has a designated "Period" column that acts as the dates, so we can't use any time inteligence 

 

Period Value
201801 7890
201802 2468
201901 2276
201902 2688
201801 3421
201802 2342
201901 3342

 

For MTD we used this code 

 

 

 

 

MTD sales = CALCULATE(SUM(Table[Value]),
    FILTER(Table, MAX(Table[Period])))

 

 

 

 

but for Last Year MTD we have been stumped, I tried something like 

 

 

 

 

 

Last Year MTD sales = CALCULATE(SUM(Table[Value]),
    FILTER(Table, (Table[Period]-100)))

 

 

 

 

but it doesn't seem to work, can someone help?

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @Retrorock 

 

Use this measure

Last Year MTD = 
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Period] = MAX ( 'Table'[Period] ) - 100 )
)

vjingzhang_0-1659692644599.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @Retrorock 

 

Use this measure

Last Year MTD = 
CALCULATE (
    SUM ( 'Table'[Value] ),
    FILTER ( ALL ( 'Table' ), 'Table'[Period] = MAX ( 'Table'[Period] ) - 100 )
)

vjingzhang_0-1659692644599.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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