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

Calculate % difference between Column Values in Matrix

Hi,

 

I am using the Matrix Visual to display 2 dimensional data. In the columns I have Month and in the Rows I have the url's visited by the user. The values section  shows the count of distinct users who have visited a particular url in the month. However I am now looking to create another column to show the % difference in the number of distinct user going up and down for each url. For example the data looks like this

                Jan            Feb

Home       20              40

Product    10              30

 

How can I add a % difference column. In Excel this can be easily achieved by referencing the cell. Is there a similar way to achieve this in DAX ?

 

 

2 REPLIES 2
kentyler
Solution Sage
Solution Sage

DAX has no concept of cells, but it does have a concept of Rows. You could probably add a calculated column something like this:

 

FebChangePercent = DIVIDE(<data_table_name>[<jan_data_column>], 

<data_table_name>[<feb_data_column>])

You would have to write a calculated column for each pair of months you want to calculate the percent of change for.

I did not address the order you want to do the division in or the formatting of the result.

 





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


If you are using measures to calculate the totals in your rows, then you can use the measure names instead of the table_name[column_name] syntax i showed.

FebPercentChange := FORMAT(

                                 DIVIDE( Jan_total, Feb_total,0),

                                 "percent"

                                               )





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


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