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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
blairc15
Regular Visitor

DISTINCTCOUNT with multiple USERELATIONSHIPS

Hello,

 

I have two tables: 1) A table (Universe Table) listing all possible stores that we could sell a product into 2) A table (Depletion Data Table) listing all stores that product was actually sold into.

 

I'm trying to create a measure to show the percentage of stores that we have sold product into over certain dimensions (dates, product type, location, etc.)

 

I've created a relationship between these two tables based on the field TDLINX_OULET_CODE. The problem is there are more outlet codes/fields in the Universe Table vs the Depletion Table.

 

When I cross filter both it removes all stores without a match in the Depletion Data Table from the Universe Table and shows too high of a distribution %. And when I conduct a Distinctcount it doesn't filter on the dimensions from the Depletion Data Table (Product, Location, etc.) showing too little of a distribution %. Finally, I tried to use USERELATIONSHIP, which works but only for one dimension at a time.

 

Is there a way to use a dynamic measure that will change with the filters applied in the Depletion Data table to the Universe Data Table. For example, if I select the dimensions, State = AK, Trade Channel = Liquor, this would show the corresponding stores in the Universe Table and thus distribution %?

 

blairc15_0-1664909892808.png

 

 

2 REPLIES 2
v-yueyunzh-msft
Community Support
Community Support

Hi , @blairc15 

Based on your description, you want to automatically modify the relationship between two tables. Right?

Currently in Power BI, USERELATIONSHIP() can only be used in functions that take a filter as an argument.

And there is an activation relationship between the two tables, and if the USERELATIONSHIP() function is not used, the current filtering context is calculated in the activation relationship, we can use the USERELATIONSHIP() function in the measure to activate the inactive relationship, and only the measure is calculated according to the relationship, if we want to implement the calculation in multiple dimensions, we need to create multiple measures to achieve.

 

Best Regards,

Aniya Zhang

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

Hi Aniya, thank you for your response. It is not feasible to have different measures. Is there another way to achieve the same result without having to use "USERELATIONSHIPS"?

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

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!

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.

Users online (27)