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! Learn more

Reply
PoojaG
Helper II
Helper II

Monthly trend line- Diff between the first month value selected by date filter and last month value

Hello,

I am trying to calculate the difference between the first value selected and last value in the trend line. I was able to achieve that for daily trend. In the picture below. the metric Positive Sentiment Increased by 11% (83% - 72%). Similarly, I would like to do for weekly trend (picture attached below), the metric should display (81%-77% = 4%) and for monthly trend (picture attached below), it should display (82%-79%=3%).

the formula used for daily trend is: 

difference % Positive = 
var startdate = [Start date]
var start_pct=
CALCULATE([% Positive],
FILTER(ALL('Date'[Time Period]),'Date'[Time Period]=startdate))
var enddate = [End date]
var end_pct=
CALCULATE([% Positive],
FILTER(ALL('Date'[Time Period]),'Date'[Time Period]=enddate))
return ABS(end_pct - start_pct)

Daily trendDaily trendMonthly trendMonthly trendWeekly trendWeekly trend

 
1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @PoojaG ,

 

We can try to use the following measure to get Monthly  Diff  percentage:

 

Monthly difference % Positive =
VAR startdate =
    YEAR ( [Start date] ) * 100
        + MONTH ( [Start date] )
VAR start_pct =
    CALCULATE (
        [% Positive],
        FILTER (
            ALL ( 'Date'[Time Period] ),
            YEAR ( [Time Period] ) * 100
                + MONTH ( [Time Period] ) = startdate
        )
    )
VAR enddate =
    YEAR ( [End date] ) * 100
        + MONTH ( [End date] )
VAR end_pct =
    CALCULATE (
        [% Positive],
        FILTER (
            ALL ( 'Date'[Time Period] ),
            YEAR ( [Time Period] ) * 100
                + MONTH ( [Time Period] ) = enddate
        )
    )
RETURN
    ABS ( end_pct - start_pct )

  


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hi @PoojaG ,

 

How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?


Best regards,

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @PoojaG ,

 

We can try to use the following measure to get Monthly  Diff  percentage:

 

Monthly difference % Positive =
VAR startdate =
    YEAR ( [Start date] ) * 100
        + MONTH ( [Start date] )
VAR start_pct =
    CALCULATE (
        [% Positive],
        FILTER (
            ALL ( 'Date'[Time Period] ),
            YEAR ( [Time Period] ) * 100
                + MONTH ( [Time Period] ) = startdate
        )
    )
VAR enddate =
    YEAR ( [End date] ) * 100
        + MONTH ( [End date] )
VAR end_pct =
    CALCULATE (
        [% Positive],
        FILTER (
            ALL ( 'Date'[Time Period] ),
            YEAR ( [Time Period] ) * 100
                + MONTH ( [Time Period] ) = enddate
        )
    )
RETURN
    ABS ( end_pct - start_pct )

  


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.