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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Chris_23
Helper II
Helper II

Filter Table by a measure does not work

Hello guys,

 

i have a little problem regarding the filter context between two tables by measure.

 

In Table (1) I have two columns. One with calculated margins and one with achieved margins. Are both available the amount of columns should be seperated in isolated Table (2) by measure 'No.':

 

Chris_23_1-1623049412940.png

 

 

No. = if(HASONEFILTER(Ergebnis[Ergebnis]);if(FIRSTNONBLANK(Ergebnis[Ergebnis];1)="SR: DB<kalk";CALCULATE(COUNT(Offer[L]);filter(Kalkulator;[DB ist]&&[DB kalk]<>blank());FILTER(Kalkulator;IFERROR([DB ist]-[DB kalk];0)<-0,05));if(FIRSTNONBLANK(Ergebnis[Ergebnis];1)="SR: DB>kalk";CALCULATE(COUNT(Offer[L]);filter(Kalkulator;[DB ist]&&[DB kalk]<>blank());FILTER(Kalkulator;IFERROR([DB ist]-[DB kalk];0)>0,05));if(FIRSTNONBLANK(Ergebnis[Ergebnis];1)="SR: DB~kalk";CALCULATE(COUNT(Offer[L]);filter(Kalkulator;[DB ist]&&[DB kalk]<>blank());FILTER(Kalkulator;IFERROR([DB ist]-[DB kalk];1)<0,05&&IFERROR([DB ist]-[DB kalk];-1)>-0,05));blank())));CALCULATE(COUNT(Offer[L]);filter(Kalkulator;[DB ist]&&[DB kalk]<>blank())))

 

Chris_23_0-1623049305613.png

 

Chris_23_2-1623050243605.png

 

But I can only filter from Table (1) to Table (2). So for example if I want to see in Table (1) only the two colums shown in the first Line of Table (2) i set the filter by clicking on this row (SR: DB<kalk). But nothing happens.


Do I have to creat a calculated column to connect it with Table (2) two get filter criteria from (2) to (1)?

 

Kind regards

Chris

 

1 ACCEPTED SOLUTION

Hi @Chris_23 

It is possible to build a measure by unrelated table. If and isfiltered function is a good way to try. And you need to filter your table by values in unrelated table in measure to get your result. All values need to filter one by one in filter function in your code. Or your measure will get a wrong result.

Can you share a sample like what you are dealing with to me by your Onedrive for Business? This may make it easier for me to understand your requirement.

 

Best Regards,

Rico Zhou

 

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

5 REPLIES 5
alam_8140
Regular Visitor

Measure =
IF( ISBLANK(max(Other column Name))
   , BLANK() ,IF([Measure]))
v-rzhou-msft
Community Support
Community Support

Hi @Chris_23 

Your measure seems to be complex, please share a sample by your Onedrive for Business.

This will make it easier for me to understand your requirement.

Did you build a one to many relationship?(Table1 one, Table2 many)  You can try to change the cross filter direction from Single to Both. Or you can build a filter measure and add this measure into the visual filter field.

Filter measure =
IF(your condition, 1,0)

Then add this measure into visual filter and set the measure to show items when value =1.

1.png

Best Regards,

Rico Zhou

 

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

 

 

Hi @v-rzhou-msft 

 

so do I have to build a relationship between the tables to get them into filter context. Is it not possible to filter from a Table with a measure which is not direct linked to the model?

 

Chris_23_0-1623218223513.png

 

Kind regards

Chris

 

Hi @Chris_23 

It is possible to build a measure by unrelated table. If and isfiltered function is a good way to try. And you need to filter your table by values in unrelated table in measure to get your result. All values need to filter one by one in filter function in your code. Or your measure will get a wrong result.

Can you share a sample like what you are dealing with to me by your Onedrive for Business? This may make it easier for me to understand your requirement.

 

Best Regards,

Rico Zhou

 

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

 

amitchandak
Super User
Super User

@Chris_23 , You measure is not very clear. To filter a measure you can use the visual level filter.

 

or you need to force a context to filter a measure 

 

example

sumx(filter(values(Table[ID]), [Measure] > 100), [Measure])

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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