Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 ?
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.
Help when you know. Ask when you don't!
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"
)
Help when you know. Ask when you don't!
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
13 | |
11 | |
9 | |
6 |