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
gurudayalsahu
Frequent Visitor

Using CROSSFILTER having issue in RLS

Hi,

I am getting the belw error after enabling RLS :

 

Couldn’t load the data for this visual : Join paths are expected to form a tree, but the table ‘location_hirearchy01’ has two join paths to table ‘subcenter’: ‘location_hirearchy01->’subcenter’ and ‘location_hirearchy01'->’subcenter’->’identifiation’->’subcenter’.

 

1. ) The below Tables has Cross Filtered relationship

followup’->’subcenter’, 

 

2.)  The below Tables has got Many to one relationship with both cross filter direction.

location_hirearchy01 (one) ->’subcenter’ (many)

 

It worked perfectally fine but after enablign the RLS, we started facing the issue.

 

blockCount = CALCULATE(DISTINCTCOUNT(location_hirearchy01[block_id]),CROSSFILTER(subcenter[asha_case_id],identifiation[asha_case_id],Both))
 
Our requirement to count the Block_id from the Table "location_hirearchy0".
 
So, what shoudl be the alternate option to be used instead of CROSSFILTER funcation.
 
Thanks in advance.
GDS
 
 
 
3 REPLIES 3
parry2k
Super User
Super User

@gurudayalsahu thanks for providing more details but unfortunately it is not very helpful, you are telling how these tables are related but not telling which table is on one side and which table is on many side. In relationship there are two parts, how tables are connected, 1 to 1, 1 to many, etc and when it comes to one to many, it is important to know which table is on many side or which table is on one side (one of these)

 

You are overcomplicating everything, it will be easier if you share a sample pbix file with the expected output, I'm sure genius here on the forum will get your solution pretty quickly and easily but you need to explain your issue in a better way.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

gurudayalsahu
Frequent Visitor

Thanks so much for quick reply.

It seems some issues or confusion  in Data Modelling due to the Cross Filtering, so i removed the measure having CrossFiltering.

The latest Model structure as follows :

 

Table#1 : subcenter          

Table#2 : location_hirearchy01 

The above Tables are having the below relationship (Many to one with Cross Filter direction as Both) and connected through the field named "Subcenter_Code"

 

gurudayalsahu_0-1639197104918.png

Table#3 : identifiation

Table#1 : subcenter  

The above Tables (Identification and Subcenter) are having the below relationship (Many to one and cross filter direction as Single) and connected through the field named "asha_id"

 

gurudayalsahu_1-1639197365897.png

Our requirement to create a measure for the distinct count of "Block_id" from "location_hirearchy01" table by filtering the "form_id" of  "identifiation" Table.

 

Block_Count = CALCULATE(DISTINCTCOUNT(location_hirearchy01[block_id]),FILTER(indentification,
COUNT(indentification[form_id]>0))
 
But its not getting the correct number of counting.
 
I used previuolsy the below Measure but due to RLS, we got it removed :
CALCULATE(DISTINCTCOUNT(location_hirearchy01[block_id]),CROSSFILTER(subcenter[asha_case_id],
indentification[asha_case_id],Both))
So could you please suggest me the proper syntax for the block_count for the unique count of the Block_id
from "location_hirearchy01", as we dont want to use the Crossfiltering.
Thanks once again in advance!
 
Best,
GDS
parry2k
Super User
Super User

@gurudayalsahu not sure what you mean by crossfilter relationship, are you referring to crossfilter to both, if that is the case why in the measure you are using crossfilter since it is already both direction.

 

Follow us on LinkedIn

 

Learn about conditional formatting at Microsoft Reactor

My latest blog post The Power of Using Calculation Groups with Inactive Relationships (Part 1) (perytus.com) I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.