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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
JCarranza24
Regular Visitor

Filter with conditional

Hi guys, I am totally new with Power Bi but I'm trying to get into this, I have a problem:

 

I have 2 matrices as below; this is chemical compositions of 2 different alloys (the first matrix is alloy A with different samples on each row, and the second matrix is alloy B), I have a manual conditional for each element (red means out of spec by max, white is ok and yellow almost out by the minimum), I would like to have a filter that if I select for example C (carbon) shows me only the elements with C out of range, and so on. On the other hand, I would like to know if I can get this conditional and filter using DAX.

 

JCarranza24_3-1659378484023.png

 

JCarranza24_2-1659378093003.png

 

I appreciatte any advice, thanks!

 

 

2 REPLIES 2
Anonymous
Not applicable

Hi  @JCarranza24 ,

I created a sample pbix file(see attachment) for you, please check whether that is what you want.

1. You can create a measure as below:

Conditional foramtting = 
VAR _minvalue = 0.2 --or the calculated min value
VAR _maxvalue = 0.8 --or the calculated max value
RETURN
    SWITCH (
        TRUE (),
        [Sum of values] < _minvalue, "yellow",
        [Sum of values] > _maxvalue, "red"
    )

2. Make conditional formatting base on 

Apply conditional formatting in tables and matrixes

yingyinr_0-1659582170582.png

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Hi @Anonymous, I really appreciate your time for helping me, I am sharing with you a simplified PowerBi file and the excel database I use as suggested:
I tried the option you gave and it works but it selects all the elements that follow the min and max values I enter, here on the example I am sharing I can show you what I am trying to do with more detail. On the little table at the bottom, I have the ranges for each element and one of the conditions I would like to be able to filter, and in the bigger table I have all my samples, the filter I was trying to create is like the one in the top; when clicking on each element I would like to have on the bigger table just the samples that are in the correct condition, for example in range, lower limit or upper limit.

 

JCarranza24_2-1659641721923.png

I tried creating a custom column for each element using code as below but I cannot get the result I want because if I use these columns to create a filter, it become a mess.

JCarranza24_4-1659642133168.png

JCarranza24_3-1659641815733.png


Again thank you very much, I am completely new to this and I appreciate any help and advice.

 

https://drive.google.com/drive/folders/1SRHiA5tH1Nw9h2KE3yj9dY7JFQ-rPb9X?usp=sharing

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors