cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

three month leaves - same period last year

Hi

 

how to write DAX function about , last three month leaves - same period last years ?

 

Thanks

sreenivasa

1 ACCEPTED SOLUTION

Accepted Solutions
v-ljerr-msft Super Contributor
Super Contributor

Re: three month leaves - same period last year

Hi @Anonymous,

 

Could you try using the formulas below to see if it works in your scenario? Smiley Happy

 

three month leaves =
VAR currentDate =
    MAX ( Date[Date] )
RETURN
    CALCULATE (
        SUM ( Table1[Value] ),
        DATESINPERIOD ( Date[Date], EDATE ( currentDate, -3 ), 3, MONTH )
    )
three month leaves same period last year =
VAR currentDate =
    MAX ( Date[Date] )
RETURN
    CALCULATE (
        SUM ( Table1[Value] ),
        DATESINPERIOD ( Date[Date], EDATE ( currentDate, -15 ), 3, MONTH )
    )

 

Regards

1 REPLY 1
v-ljerr-msft Super Contributor
Super Contributor

Re: three month leaves - same period last year

Hi @Anonymous,

 

Could you try using the formulas below to see if it works in your scenario? Smiley Happy

 

three month leaves =
VAR currentDate =
    MAX ( Date[Date] )
RETURN
    CALCULATE (
        SUM ( Table1[Value] ),
        DATESINPERIOD ( Date[Date], EDATE ( currentDate, -3 ), 3, MONTH )
    )
three month leaves same period last year =
VAR currentDate =
    MAX ( Date[Date] )
RETURN
    CALCULATE (
        SUM ( Table1[Value] ),
        DATESINPERIOD ( Date[Date], EDATE ( currentDate, -15 ), 3, MONTH )
    )

 

Regards

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Users Online
Currently online: 209 members 1,608 guests
Please welcome our newest community members: