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
Grella
Frequent Visitor

Measure for conditional formating with more than 1 condition and using columns from related tables

I am trying to create a measure (i'm not sure if a measure or calculated column is what i should be using) that will ultimately be used purely for conditional formatting. I know how to navigate the conditional formatting settings however i need the measure to use as the "rule".

 

I have 2 related tables: StoreSales (sales revenue from stores) and dStore (includes store status, open/closed, and store close down date if it is closed etc).

In a matrix table visual i want to conditionally format cells as follows:

 

- if store status is closed and store close down date is less than sales month, then 1 (trying to visually highlight months when the store closed down eg. Arlington Heights)

- if store status is open and sales month is blank, then 2 (trying to highlight months where there were no sales at all eg. Lakeland)

 

Grella_0-1715311788759.png

 

 

I've found various solutions online using SWITCH TRUE() or IF statements that look to work in theory but i can't replicate as dax intellisense will not pick up my table columns and will only let me use measures - no doubt I am doing something wrong!

 

Any help would be appreciated 🙂 

 

EDIT: Link to pbix and supporting files here

 

6 REPLIES 6
DataNinja777
Super User
Super User

Hi @Grella ,

In my opinion, in order to do it properly, in addition to the store close date field, we need the information of when the store opened so that we can see the duration of the period during which the stores were in operation (to highlight in blue where there were no sales and in yellow if that is after the closure).  Without the opening date information, we cannot determine regarding the past information whether the lack of sales (to be blue highlighted) is due to the store not being open for that month (not starting up) or due to poor performance.  

Best regards,

I have included supporting files with open date data also, appreciate any assistance.

lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

thanks for the tips, i have added alink to a pbix file

For some reason I have a hard time making the color stick. It disappears when the measure is removed. Maybe someone else can spot my error.

 

lbendlin_0-1715639185635.png

 

 

Thanks for your efforts, i see the issue but cannot resolve either

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.