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
shaikhabib
Frequent Visitor

Present Year Latest quarter to Previous year Last Quarter

Hi,

I am new to power BI, i have a query which i tried a lot, my data as like below 

YearQuarterTotal Sale
2014Q1563
2014Q2512
2014Q316541
2014Q453
2015Q1265
2015Q2236546
2015Q3965
2015Q4365
2016Q1786
2016Q2265
2016Q336654
2016Q4148641
2017Q15164
2017Q2165
2017Q3

165

 

 

I wan to show to differene for 1. 2016 Q4 to 2015 Q4 difference similary 2015 Q5 to 2014 Q4

                                                 2. 2017 Q3 to 2016 Q3  (present year latest Quarter to Previous Year Last Quarter)

in a single calculation.

Please help me on this. thanks in advance.

 

--Habib.

1 ACCEPTED SOLUTION
2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

Hi @shaikhabib

 

Try this MEASURE

 

Difference =
VAR SamePeriod_LY =
    CALCULATE (
        SUM ( TableName[Total Sale] ),
        FILTER (
            ALL ( TableName[Year] ),
            TableName[Year]
                = SELECTEDVALUE ( TableName[Year] ) - 1
        )
    )
RETURN
    IF (
        NOT ( ISBLANK ( SamePeriod_LY ) ),
        SUM ( TableName[Total Sale] ) - SamePeriod_LY
    )

Regards
Zubair

Please try my custom visuals

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.