Forum Discussion
How to create a simple Bowler chart in Power BI?
- 1 year ago
Hi Deepak89028
It would be DAX measure like below.
HighlightActualRow = IF ( SELECTEDVALUE('Table'[Attribute]) = "Actual", "Red", BLANK() )Apply on Values,
and set up as in picture
You would have
Hope it helps:)
- 1 year ago
Thank you, MasonMA and bhanu_gautam , for your time and suggestions.
The final solution is extended basis suggestion from MasonMA.
Firstly, I need to unpivot the columns of plan and actual and load the values in a matrix, wherein we need to load Attribute as Rows and Date as Column.
I need to create a dax measure that gives output by comparing Plan and Actual in terms of 1 and 0 for respective month. Refer the DAX measure below.
Color Logic = VAR CurrentAttribute = SELECTEDVALUE('KPI'[Attribute]) VAR CurrentMonth = SELECTEDVALUE('KPI'[Month]) VAR ActualValue = CALCULATE( MAX('KPI'[Value]), 'KPI'[Attribute] = "Actual", 'KPI'[Month] = CurrentMonth ) VAR PlanValue = CALCULATE( MAX('KPI'[Value]), 'KPI'[Attribute] = "Plan", 'KPI'[Month] = CurrentMonth ) RETURN IF( CurrentAttribute = "Actual", IF(ActualValue > PlanValue, 1,IF(ActualValue = PlanValue, 1, 0)), BLANK() )Then in conditional formatting, use the "Rules" format style and select the newly created measure to define the color as shown below.
Here is the final output.
Hi, before using Matrix visual in reporting you would need to transform data a bit in Power Query
1. Add a Custom column
#date(2023, [Month], 1)2. Unpivot Columns 'Plan' and 'Actual' as below
to give you
In Power BI reporting, use Attribute as Rows and Date as Columns. and apply your conditional formatting if you like.
Hope it helps:)
Thank you MasonMA , it helped.
Can you help me figure out how to do conditional formatting for the color? Since Actual and Plan are unpivoted, I cannot calculate the difference between Plan and Actual and use that to color code. I guess some complex DAX is required here to color code.
- MasonMA1 year ago
Super User
Hi Deepak89028
It would be DAX measure like below.
HighlightActualRow = IF ( SELECTEDVALUE('Table'[Attribute]) = "Actual", "Red", BLANK() )Apply on Values,
and set up as in picture
You would have
Hope it helps:)