Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Values = Count_of_user_id
Hi @Subham_Ranjan
To calculate the column-wise percentage change in a Power BI matrix, you need to compute the difference between the current and previous month's values and then divide by the previous month's value. Here’s how you can create a measure to achieve this:
Column_Wise_Percentage_Change =
VAR _CurrentValue = SELECTEDVALUE(bull_users[Count_of_user_id])
VAR _PreviousValue =
CALCULATE(
SELECTEDVALUE(bull_users[Count_of_user_id]),
bull_users[Month No] = MAX(bull_users[Month No]) - 1
)
RETURN
IF(
NOT(ISBLANK(_PreviousValue)) && _PreviousValue <> 0,
(_CurrentValue - _PreviousValue) / _PreviousValue,
BLANK()
)
Create a Measure for Percentage Change:
Percentage Change =
VAR CurrentMonth = SELECTEDVALUE('Table'[Month No])
VAR PreviousMonth = CurrentMonth - 1
VAR CurrentValue = CALCULATE(SUM('Table'[Count_of_user_id]), 'Table'[Month No] = CurrentMonth)
VAR PreviousValue = CALCULATE(SUM('Table'[Count_of_user_id]), 'Table'[Month No] = PreviousMonth)
RETURN
IF(
ISBLANK(PreviousValue),
BLANK(),
DIVIDE(CurrentValue - PreviousValue, PreviousValue, 0)
)
Drag the newly created measure Percentage Change to the Values area of the matrix.
You can format the measure as a percentage by selecting the measure in the Fields pane, then going to the Modeling tab and selecting the percentage format.
Proud to be a Super User! |
|
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.
| User | Count |
|---|---|
| 6 | |
| 6 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 22 | |
| 10 | |
| 10 | |
| 7 | |
| 5 |