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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
powerbiexpert22
Impactful Individual
Impactful Individual

filter table

i am trying to calculate mixed orders count however it shows same result for all years, it is happening because date table is not filtering my calculated table . i do not want to enable bidirectional relationship since it is not recommended. is there any alternate solution to show year wise results. please see below pbix file for your reference

 

https://drive.google.com/file/d/1XNkXKCBkl5tD60nA82ALNPEIDILJRu1b/view?usp=drive_link

 

powerbiexpert22_0-1725252828852.png

powerbiexpert22_1-1725252996832.png

 

 

2 ACCEPTED SOLUTIONS
PBIViz_2024
Advocate I
Advocate I

Hi,

Try below Dax

Mixed Orders =
    CALCULATE(DISTINCTCOUNT(orders[order_id]),orders[order_id] in values(Mixedwithoutblank[offline_order_id]))
PBIViz_2024_0-1725253842622.png

If this works,Please do not froget to accept as solution.

 

Regards

View solution in original post

Hi  @powerbiexpert22 

please refer this Microsoft doc where they have not mentioned any thing about not to use bi-directional filter.

 

yes it is not recommended to use many to many but not birectional.

 

https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-relationships-understand?source=r...

 

Reason of Security filter checkbox
https://learn.microsoft.com/en-us/fabric/security/service-admin-row-level-security

 

I hope this may clear your doubts.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

3 REPLIES 3
Uzi2019
Super User
Super User

Hi @powerbiexpert22 

In some scenario you have to apply security filter in both direction. 
you can choose cross filter direction (both) anf apply security filter also.

Uzi2019_0-1725253839543.png

 

 

it will resolve your issue.

Uzi2019_1-1725253877048.png


Reason for security filter :

By default, row-level security filtering uses single-directional filters, regardless of whether the relationships are set to single direction or bi-directional. You can manually enable bi-directional cross-filter with row-level security by selecting the relationship and checking the Apply security filter in both directions checkbox. 

 

This option is only relevant if you have set row-level security in your model.
For a RLS to be effective across multiple instances of Dim table and not explicitly on the one which we created ,we have to explicitly Apply security filter in both directions.

 

For example, I have 2 DIM tables for Employee and Company, and 2 fact tables for EmployeeSalary and Sales.

Company and sales are 1:m relationship, Employee and EmployeeSalary are 1:1 relationship, Company and Employee are 1:m relationship

Assume that RLS is applied to the Employee table based on login.

If a bidirection filter is not applied, slicing by company is used for sales and employee salaries.
The result will be that the employee will be able to see not only his salary but also the sales of all companies
If a bidirection filter exists, then the user will only see sales for the company he is tagged in.

 

For more information,you can refer to:How does Row Level Security works when there is a BI-Directional Filter in Power BI/Tabular Model? 

 

 

Hope it helps,

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Hi  @powerbiexpert22 

please refer this Microsoft doc where they have not mentioned any thing about not to use bi-directional filter.

 

yes it is not recommended to use many to many but not birectional.

 

https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-relationships-understand?source=r...

 

Reason of Security filter checkbox
https://learn.microsoft.com/en-us/fabric/security/service-admin-row-level-security

 

I hope this may clear your doubts.

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
PBIViz_2024
Advocate I
Advocate I

Hi,

Try below Dax

Mixed Orders =
    CALCULATE(DISTINCTCOUNT(orders[order_id]),orders[order_id] in values(Mixedwithoutblank[offline_order_id]))
PBIViz_2024_0-1725253842622.png

If this works,Please do not froget to accept as solution.

 

Regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.