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
Anonymous
Not applicable

undefined

Hi PBI Experts, 
I am a new learner of Power Bi, but have a query with which I need Help.

I am trying to achieve conditional formatting on data with heirarchy, but not able to get desired solutions. 
just briefing you about the hierarchy of data : Lets say, I have a column called Product which has all the products listed. So my hierarchy goes like
Product --> SubCategory_1 --> SubCategory_2 --> Subcategory3.

Now in my report, I need Product as column header and SubCategory_1 as its value (I have used matrix to achieve this).
I need to apply conditionally formatting on Subcategory_1 values based on statues of SubCategory_1 and SubCategory_3.

Ravisha_1-1631117628000.png

 

I have created a new column where i am calculating the logic using IF-THEN_ELSE statment. 
the issue is that if-else statment is giving me 2 different output due to hierarchical data.

Can someone please help me with this issue. Any immediate help is appreciable. Matrix. Conditional format. 

Thank you in advance.

 

 





1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi All, 
I have now changed the logic into 2 different measures and with the help of Button and Bookmark i was able to meet my requirment. 
so closing this thread and Thank you all for your help.

 

Regards,

Ravisha

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi All, 
I have now changed the logic into 2 different measures and with the help of Button and Bookmark i was able to meet my requirment. 
so closing this thread and Thank you all for your help.

 

Regards,

Ravisha

v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

Could you tell me if @sm_talha 's post helps you a little? If it is, kindly Accept it as the solution to make the thread closed. More people will benefit from it.Hope to hear from you‌‌

 

Best Regards,
Eyelyn Qin

v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

You may try ISINSCOPE() to change the first hierarchy:

Measure = IF(ISINSCOPE('Table'[Sub2]),BLANK(),0)

Eyelyn9_0-1631513033439.png

Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi ,
Thanks for responding.
I tried using Switch statment too but It is giving me 2 different output. 

Let me show you my IF-else logic - 

Ravisha_0-1631199895753.png


I tried the same with SWITCH statment, but that gave me same outcome.

Please suggest. Matrix. Conditional format. 




mh2587
Super User
Super User

https://radacad.com/write-conditional-statement-using-switch-in-dax-and-power-bi

follow the link and make measure like in url then apply to the desired coulumn in conditional formatting using field value


Did I answer your question? If so, please mark my post as a solution!


Proud to be a Super User!




LinkedIn Icon
Muhammad Hasnain



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.