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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
nandukrishnavs
Community Champion
Community Champion

How can I calculate the difference of scores between previous quarter and current quarter

DateCategoryScore
01-01-2016A3
01-01-2016B2
01-01-2016C4
04-04-2016A2.5
04-04-2016B2.5
04-04-2016C4
08-08-2016A2
08-08-2016B3
08-08-2016C2
12-12-2016A3
12-12-2016B3
12-12-2016C3
02-02-2017A3
02-02-2017B2
02-02-2017C4
06-06-2017A3.5
06-06-2017B2
06-06-2017C2.5
   

 

 

In this table contain quarterly scores of different categories. How can i calculate the difference between previous quarter and current quarter in a calculated column.


Regards,
Nandu Krishna

1 ACCEPTED SOLUTION

Hi @v-qiuyu-msft

 

I got the Dax query. Below query works for me.

 

final result.PNG

 

CurrentQuarterScore-PreviousQuarterScore = 
VAR currentQuarterScore =
    CALCULATE ( SELECTEDVALUE ( Table1[Score] ) )
VAR selectedCategory =
    SELECTEDVALUE ( Table1[Category] )
VAR previousQuarterScore =
    CALCULATE (
        SUM ( Table1[Score] ),
        ALLEXCEPT ( Table1, Table1[Category] ),
        PREVIOUSQUARTER ( Table1[Date] )
    )
VAR difference =
    CALCULATE ( currentQuarterScore - previousQuarterScore )
RETURN
    difference

Regards,
Nandu Krishna

View solution in original post

3 REPLIES 3
v-qiuyu-msft
Community Support
Community Support

Hi @nandukrishnavs,

 

You can create a calculated column below: 

 

QuarterDiff(current-previous) = TOTALQTD(SUM('Table1'[Score]),'Table1'[Date],ALL(Table1))-CALCULATE(SUM(Table1[Score]),ALL(Table1),PREVIOUSQUARTER('Table1'[Date]))
 
q2.PNG
 
Best Regards,
Qiuyun Yu 
Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi  @v-qiuyu-msft

 

Thanks for the reply. 

It seems results are not correct.


Expected values are mentioned in red colorExpected values are mentioned in red color

 

 


Regards,
Nandu Krishna

Hi @v-qiuyu-msft

 

I got the Dax query. Below query works for me.

 

final result.PNG

 

CurrentQuarterScore-PreviousQuarterScore = 
VAR currentQuarterScore =
    CALCULATE ( SELECTEDVALUE ( Table1[Score] ) )
VAR selectedCategory =
    SELECTEDVALUE ( Table1[Category] )
VAR previousQuarterScore =
    CALCULATE (
        SUM ( Table1[Score] ),
        ALLEXCEPT ( Table1, Table1[Category] ),
        PREVIOUSQUARTER ( Table1[Date] )
    )
VAR difference =
    CALCULATE ( currentQuarterScore - previousQuarterScore )
RETURN
    difference

Regards,
Nandu Krishna

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors