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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
ganeshnr073
Helper I
Helper I

Percentage difference

Hi

 

Need help to calculate the percentage differnce bwtween dates, with refrence to the Happy% column in the table. And based on increase or decarese need to show a visual if it's dropped or increased.

 

Thanks

 

ganeshnr073_0-1686731616286.png

 

1 ACCEPTED SOLUTION
grazitti_sapna
Super User
Super User

Hi @ganeshnr073 

You can achieve this by creating a calculated column 

PercentageDifference =
VAR CurrentRowDate = 'YourTable'[Date]
VAR PreviousRowDate =
CALCULATE(
MAX('YourTable'[Date]),
FILTER('YourTable', 'YourTable'[Date] < CurrentRowDate)
)
VAR CurrentRowHappy = 'YourTable'[Happy%]
VAR PreviousRowHappy =
CALCULATE(
MAX('YourTable'[Happy%]),
FILTER('YourTable', 'YourTable'[Date] = PreviousRowDate)
)
RETURN
IF(
ISBLANK(PreviousRowHappy),
BLANK(),
DIVIDE(CurrentRowHappy - PreviousRowHappy, PreviousRowHappy)
)

 

Thn create a other column 

Change =
SWITCH(
TRUE(),
'YourTable'[PercentageDifference] > 0, "Increased",
'YourTable'[PercentageDifference] < 0, "Decreased",
"No Change"
)

This formula uses the SWITCH function to categorize the percentage difference as "Increased" if it's greater than 0, "Decreased" if it's less than 0, and "No Change" if it's 0

Thank you. Hope this will help

View solution in original post

1 REPLY 1
grazitti_sapna
Super User
Super User

Hi @ganeshnr073 

You can achieve this by creating a calculated column 

PercentageDifference =
VAR CurrentRowDate = 'YourTable'[Date]
VAR PreviousRowDate =
CALCULATE(
MAX('YourTable'[Date]),
FILTER('YourTable', 'YourTable'[Date] < CurrentRowDate)
)
VAR CurrentRowHappy = 'YourTable'[Happy%]
VAR PreviousRowHappy =
CALCULATE(
MAX('YourTable'[Happy%]),
FILTER('YourTable', 'YourTable'[Date] = PreviousRowDate)
)
RETURN
IF(
ISBLANK(PreviousRowHappy),
BLANK(),
DIVIDE(CurrentRowHappy - PreviousRowHappy, PreviousRowHappy)
)

 

Thn create a other column 

Change =
SWITCH(
TRUE(),
'YourTable'[PercentageDifference] > 0, "Increased",
'YourTable'[PercentageDifference] < 0, "Decreased",
"No Change"
)

This formula uses the SWITCH function to categorize the percentage difference as "Increased" if it's greater than 0, "Decreased" if it's less than 0, and "No Change" if it's 0

Thank you. Hope this will help

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.