The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |