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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
klehar
Helper V
Helper V

Filtering fact tables using inactive dimension tables

Hi,

 

I have stripped down my dataset to make my case understandable.

 

I have a relationship between product dimension and fact dimension. But this relationship is inactive(in my original dataset with a complicated model, i cannot connect these 2 tables becuase of ambiguous relationships)

Actual dataset error:

klehar_2-1619447431538.png

 

 

klehar_1-1619447289349.png

 

My goal here is to filter the sales table below using the product dimension column using an inactive relationship

 

 

klehar_0-1619447266067.png

Can this be done?

 

@amitchandak please dont send links, if you have a solution only then reply

 

9 REPLIES 9
PaulDBrown
Community Champion
Community Champion

@klehar 

Create a measure along the lines of

Filter using Userelationship =
COUNTROWS (
    CALCULATETABLE (
        VALUES ( Fact[ProductID] ),
        USERELATIONSHIP ( 'Dimension'[ProductID], Fact[ProductID] )
    )
)

or

Filter using TREATAS =
COUNTROWS ( TREATAS ( VALUES ( Dimension[ProductID] ), Fact[ProductID] ) )


Select the visual, add this measure to the filters on the visual in the filter pane and set the parameter to "is 1".





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Can you also explain what this does.

Btw syntax is incorrect somewhere

@klehar 

Regarding the syntax, adjust the table and column references to your model (for example use Product ID instead of my ProductID)

As regards what they do:

[Filter using userelationship]
1) CALCULATETABLE returns a table of unique values for fact[ProductID] based on the filter enacted between the dimension table and fact table using USERELATIONSHIP

2) COUNTROWS returns the count by row

 

[Filter using Treatas]

1) TREATAS creates a virtual relationship between the columns contained within the expression to return a table of ProductID values.

2) COUNTROWS returns the count by row

 

When you add either of these measures to the filter pane and establish the parameter as 1, the visual will be filtered to display only the values selected in the slicer.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






aj1973
Community Champion
Community Champion

Hi @klehar 

To be able to use Product column as a slicer in your model you need to add a Calculated column (slicers don't accept measures) to the fact table using the inactive relationship if it exist. You can also use Crossjoin to navigate between tables and to build your calculated column.

Here is a video that can help solve the ambiguity if you want

https://www.youtube.com/watch?v=x3m7qzsVJqQ

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

@aj1973 can you give an example dax code?

MikeJohnsonZA
Responsive Resident
Responsive Resident

Yes, this can be done but you will need to use an explicit measure for it (This is probably what you are doing already).

 

Sales =
CALCULATE (
    SUM ( fact[sales] ),
    USERELATIONSHIP ( dimension[product ID], sales[Product ID] )
)

 

*To help reduce the model complexity and ambiguity, try to only use bidirectional relationships where absolutely necessary. (Sometime easier said than done)

 

 

If you have multiple measures in your report then each of them will need to apply the same pattern. 

 

@MikeJohnsonZA I dont want to calculate a measure so crossfilter and userelationship may not work

I just want to filter the sales table using my dimension table without an active join

Jihwan_Kim
Super User
Super User

Hi, @klehar 

Please correct me if I wrongly understood your question.

If you have an inactive relationship between two tables, using USERELATIONSHIP function is one way to create a measure that can be filtered by one dimension table.

 

Please try the below measure.

 

Sales =
CALCULATE (
SUM ( Fact[sales] ),
USERELATIONSHIP ( Fact[Product ID], Dimension[Product ID] )
)

 

Hi, My name is Jihwan Kim.

 

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

 

Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

@Jihwan_Kim , I'm afraid userelationship cant be used.

I thought it can be. But all im trying to do is filter the fact using the dimension table with an inactive relationship.

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors