Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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 trend
Monthly trend
Weekly trend
Solved! Go to Solution.
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,
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,
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,
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |