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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
showy123
Frequent Visitor

Filter Context of Table or Measures

The following initial situation:

The evaluation considers measured values of characteristics in fruits. In our example, Brix and pH. In the real case there are about 25 Specs which are tested.
A range is to be controlled via the slicers in order to filter the table and find out which products comply with the ranges.

The blue table shows the initial values for each fruit.

The Measure M_SpecName_Lower/Upper check whether the lower or upper value is within the set range.
If the lower and upper values are within the range, the fruit is marked with a 1 1.
If only the lower or upper value is within the range, only the corresponding measure is given a 1.

showy123_0-1702286997917.png

The measure for determining the 1 marking has this structure. it is underlined in red because we use German words. I have replaced these with English words to make it easier to understand.

showy123_1-1702287097156.png

 

Now to the goal:
For example, I am looking for an apple with Brix 38 to 45 and pH between 6 and 10.

 

showy123_4-1702288118242.png

 

This evaluation should find fruits that fit my characteristics. 
I want to see Apple1 and Apple2.
Apple1 hits all ranges, apple2 hits only one at pH.But that is enough to want to see it. I don't want to see apple3, because one characteristic with upper and lower values is not in the range.

So the general rule should be.
I select the features I want to see in SpecParamType. Then I set my ranges. As soon as a fruit in one characteristic does not have both values within the limit, it should not be displayed.

What is the best way to implement this?




1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @showy123 ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create numerical parameters.

Brix = GENERATESERIES(0, 50, 1)
pH = GENERATESERIES(0, 20, 1)

(3)We can create a measure.

Flag = IF(MAX('Table'[Brix Lower]) >= MIN('Brix'[Brix]) && MAX('Table'[Brix Upper]) <= MAX('Brix'[Brix]) && MAX('Table'[pH Lower])>= MIN('pH'[pH]) && MAX('Table'[pH Upper]) <= MAX('pH'[pH]),1,0)

(4) Place [Flag=1] on the screening of the visual object and then the result is as follows.

vtangjiemsft_0-1702436351155.png

Best Regards,

Neeko Tang

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

View solution in original post

1 REPLY 1
v-tangjie-msft
Community Support
Community Support

Hi @showy123 ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create numerical parameters.

Brix = GENERATESERIES(0, 50, 1)
pH = GENERATESERIES(0, 20, 1)

(3)We can create a measure.

Flag = IF(MAX('Table'[Brix Lower]) >= MIN('Brix'[Brix]) && MAX('Table'[Brix Upper]) <= MAX('Brix'[Brix]) && MAX('Table'[pH Lower])>= MIN('pH'[pH]) && MAX('Table'[pH Upper]) <= MAX('pH'[pH]),1,0)

(4) Place [Flag=1] on the screening of the visual object and then the result is as follows.

vtangjiemsft_0-1702436351155.png

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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