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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
marcofalzone
Helper I
Helper I

Conditional Formatting with Calculation Groups - Issues, please help me

Hi community, I developed a model with some conditional formatting, and I'm quite happy with it.

Since the number of measures is quickly growing, I've started to implement Calculation Groups, to make it more efficient, and the model actually works fine with calculation groups implemented. Despite that, I found some issues with a simple conditional formatting configuration.

 

Download - Sample Model (300 kb):

https://www.dropbox.com/scl/fi/4sju5841r4m3afq7tewdo/Help_CalcGroups.zip?rlkey=v65nx5eshluxkz310ta7j...

 

My basic conditional formatted visual without calculation groups looks as follows, and works just fine.

 

Screenshot_1.jpg

 

The formatting condition is pretty simple and based on one field.

The background of the rows of the table 'PL_Structure' is light blue where the field 'PL_Structure' [PL_Detail] has value 0 (running total rows), while are colored in light grey where the field value is 2 (subtotal row). The other - common rows - stay white (default color).

The structure of the table can be found in the attachment together with the model (DataSource.xlsx), and includes an explanation of key fields as well.

 

Screenshot_4.jpg

 

My formatting conditions

The "PL SubTot Color" measure simply reads the SELECTEDVALUE of the above mentioned [PL_Detail] field):

 

Screenshot_3.jpg

Now, with calculation groups implemented, I'm experimenting a strange behaviour, the numbers are just ok, but the table looks as follows:

 

Screenshot_2.jpg

 

Maybe I did not fully understand the logics behind calculation groups, but I find them extremely useful for maintenance purposes.

The attached model includes a side by side (with / without calculation groups).

 

I do appreciate any suggestion or fix. Thank you.

Marco 

 

 

 

1 ACCEPTED SOLUTION
marcofalzone
Helper I
Helper I

I found the solution by myself. If somebody is interested, let me know, to post it.

Thanks anyway to all.

Marco

View solution in original post

7 REPLIES 7
shinym201290
Frequent Visitor

hi @marcofalzone -
I am also looking for a similar solution where I can do formatting for particular groups at row level in a matrix using calculation groups.
It would be great if you can post the solution or links that can help

Sure, let me know if you prefer to send me a sample of your dataset (real case), or as alternative, I can give a generic example based on my experience. 

@marcofalzone - Thanks for the quick response!
I have calculation group with two items Sales and Quantity.
I would like to apply background color only on Sales column and for the Category - Bikes
Sample File

formatting.png

Hello @shinym201290 , 

 

thanks for the opportunity to help and give something back to this great community.

I downloaded your sample model and found that in this specific case you maybe don't need to involve calculation groups at all, for the category selection.

 

In the proposed solution attached you can find a smoother alternative that allow you to color one (or more) specific categories (like bikes) using a combination of one simple detached table and one selection measure. Plus, a simple and convenient conditional formatting measure.

 

Information.jpg

 

Sample.jpg

 

Please, let me know if this solution fit your needs, and thanks again for enquiring me, I'm pleased to help.

 

In the attachment you can also find an "Information" tab with indications shown in this message.

 

Download link: 
https://www.dropbox.com/scl/fi/72nlwuacmja7k8ohibli4/Calculation-groups-bg-formatting-V2.pbix?rlkey=...

 

PD: If you're still interested in conditional formatting with calculation groups, I can share the solution I currently use with tables visuals and matrix visuals in my models.

 

Marco Falzone - Monterrey, Mexico

@marcofalzone  - Thanks for the detailed explanation and solution.
It was my bad that I did not illustrate clearly why we wanted to go with calculation group for a basic use case.
Please find the sample report with the use case and why we decided to go with calculation groups.

 

If you think its time consuming to go through the use case. It would be great if you can provide the solution for conditional formatting with calculation groups if you have one already!

 

Thank you for your time!

marcofalzone
Helper I
Helper I

I found the solution by myself. If somebody is interested, let me know, to post it.

Thanks anyway to all.

Marco

Can you please share? I have same problem. Thanks

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.