Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
djallarii
Helper I
Helper I

Is it possible to retain formatting strings in a "helper table" for use in a matrix?

Hi Power BI Community,

 

I am trying to create a kind of "balanced scorecard/stop light report" using a matrix in Power BI and I am curious if the formatting of individual rows or cells can be altered independlty of eachother or by storing formatting strings or conditional formatting in a "helper table".

 

I will try my best to explain in the example below.

 

Let's say our data is stored like the following table where Measures will be populated in the matrix rows, Header Group will be populated in the matrix columns, Values will be populated in the matix values, and Header Sort is used to maintain proper sort order.

 

Data Table Example
MeasuresValuesHeader GroupHeader Sort
Measure 10.0451/1/20231
Measure 212141/1/20231
Measure 322250001/1/20231
Measure 10.0152/1/20232
Measure 215442/1/20232
Measure 318046552/1/20232
Measure 10.05Target99
Measure 21250Target99
Measure 32000000Target99

 

Without any formatting the resulting matrix looks like this:

 

MeasuresJan-23Feb-23Target
Measure 10.0450.0150.05
Measure 2121415441250
Measure 3222500018046552000000

 

In our legacy system, we can store formatting in a helper table such as this:

 

Format Table
MeasuresFormatPolarity
Measure 1PercentageValue < Target = Green
Measure 2Whole numbers, commasValue < Target = Red
Measure 3Decimal, abbreviated K/M/BValue < Target = Red

 

And once we relate our data table to the format table, the resulting report is represented like this:

 

Resulting Matrix
MeasuresJan-23Feb-23Target
Measure 14.5%1.5%5%
Measure 21,2141,5441,250
Measure 32.23M1.80M2.00M

 

As you can see, the values of Measure 1 need to be represented as a percentage, Measure 2 needs to be represented as a whole number with commas, and Measure 3 needs to be represented as a decimal number with thousands/millions/billions abbreviated. Each measure needs a color coding based on its relationship to the target value.

 

If anyone can use these examples to create an example file or point me in the direction of online tutorials, I would greatly appreciate it!

1 ACCEPTED SOLUTION
ray_aramburo
Super User
Super User

Sure you can.

First create the logic to format each measure, for example, Measure1Color = IF(SUM(Table[Value]) < Target, "Green", "Black") 

You can also use a Hex Code instead of the standard naming convention. Create the rest of the measures.

Then, go to the formatting pane of the matrix and go to submenu Cell elements.

ray_aramburo_0-1688060740871.png

There select a series (each measure in this case), turn on Font color and click on Fx. There select By Field Value in Format style:

ray_aramburo_1-1688060827634.png

Search for the color measure that corresponds to it and select it. Finally, click OK. 

For decimals and % format you can do that at a measure level in the Measure Tools menu when selecting the measure.

ray_aramburo_2-1688060995701.png

 





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
ray_aramburo
Super User
Super User

Sure you can.

First create the logic to format each measure, for example, Measure1Color = IF(SUM(Table[Value]) < Target, "Green", "Black") 

You can also use a Hex Code instead of the standard naming convention. Create the rest of the measures.

Then, go to the formatting pane of the matrix and go to submenu Cell elements.

ray_aramburo_0-1688060740871.png

There select a series (each measure in this case), turn on Font color and click on Fx. There select By Field Value in Format style:

ray_aramburo_1-1688060827634.png

Search for the color measure that corresponds to it and select it. Finally, click OK. 

For decimals and % format you can do that at a measure level in the Measure Tools menu when selecting the measure.

ray_aramburo_2-1688060995701.png

 





Did I answer your question? Give your kudos and mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.