Forum Discussion
Percentage Difference using a Date variable
- 2 years ago
Anonymous It's not an option to click and select something, that line means to add a column named "% Difference". Okay leave it, we can create a matrix visual.
Here are the steps to create a table:
- Open Power BI Desktop and click on “Get Data” to import your dataset.
- Once your data is loaded, click on “Report” in the left-hand pane.
- Click on the “Matrix” visual in the “Visualizations” pane.
- Drag the “WeekEnd” field to the Rows section of the visual.
- Drag the “Transf” field to the Values section of the visual.
- To add a column that shows the % difference from the week before, you can use Power BI’s formula feature. Here are the steps to add a column:
- Click on “New Measure” in the “Fields” pane.
- In the formula bar, enter the following formula:
Percent Difference = DIVIDE([Transf] - CALCULATE([Transf], PREVIOUSWEEK([WeekEnd])), CALCULATE([Transf], PREVIOUSWEEK([WeekEnd])))- Click on “OK”.
- Drag the “Percent Difference” field to the Values section of the visual.
This will give you a table with WeekEnd in rows, Transfers in columns, and a new column that shows the % difference from the week before.
I hope this helps!
If you find this insightful, please provide a Kudo and accept this as a solution.
Thank you for your reply, however this isn't an option to Right-click on the Transfers field in the Values section and select Add Column > % Difference. in my version of powerBI
- devesh_gupta2 years agoImpactful Individual
Anonymous It's not an option to click and select something, that line means to add a column named "% Difference". Okay leave it, we can create a matrix visual.
Here are the steps to create a table:
- Open Power BI Desktop and click on “Get Data” to import your dataset.
- Once your data is loaded, click on “Report” in the left-hand pane.
- Click on the “Matrix” visual in the “Visualizations” pane.
- Drag the “WeekEnd” field to the Rows section of the visual.
- Drag the “Transf” field to the Values section of the visual.
- To add a column that shows the % difference from the week before, you can use Power BI’s formula feature. Here are the steps to add a column:
- Click on “New Measure” in the “Fields” pane.
- In the formula bar, enter the following formula:
Percent Difference = DIVIDE([Transf] - CALCULATE([Transf], PREVIOUSWEEK([WeekEnd])), CALCULATE([Transf], PREVIOUSWEEK([WeekEnd])))- Click on “OK”.
- Drag the “Percent Difference” field to the Values section of the visual.
This will give you a table with WeekEnd in rows, Transfers in columns, and a new column that shows the % difference from the week before.
I hope this helps!
If you find this insightful, please provide a Kudo and accept this as a solution.