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
Anonymous
Not applicable

Dax formula to calculate % Change, and then Conditional Formatting of that result

This is sort of a compound problem:

 

I have a data table that contains the vacancy by geography and time period.

 

I have a matrix visualization that shows that vacancy in two time periods.

 

I would like to calculate the % change between only those two time periods, and then apply background conditional formatting to only the 2020.06 column of a color range of highest to lowest, and sort the table by the % change of highest to lowest.

 

The two time periods: 2019.06 and 2020.06

% Change = (The vacancy of 2020.06 - the vacancy of 2019.06) / (the vacancy of 2020.06)

 

This is the matrix table. 

Image 7.png

 

 

3 REPLIES 3
harshnathani
Community Champion
Community Champion

HI @Anonymous ,

 

 

Assuming 2019.06 and 2020.06 are measures

 

Create a new measure

 

PercentChange = DIVIDE([2020.06] - [2019.06] , [2020.06])

 

 

Incase 2019.06 and 2020.06 are columns

 

Create a new measure

PercentChange = DIVIDE(MAX('Table'[2020.06]) - 'Table'(MAX( [2019.06])  , MAX('Table'[2020.06]))

 

 

Then Select the 2020.06 Column and Right Click, Select Background Formatting.

 

1.jpg

 

 

 

From the dropdown Select the measure PercentChange

 

 

2.JPG

 

 

Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

 

Anonymous
Not applicable

2019.06 and 2020.06 are values within a column titled 'Year Mo'

HI @Anonymous ,

 

Share sample Data Please in text form

 

Regards,

Harsh Nathani

 

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.

Top Solution Authors