cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Issues with data model and bidirectional filters

Hi Dear Community Experts, 

will be very grateful for any advice you can share on the issue based on the following data model:

 

Data_model.PNG

 

As you can see I have 2 dimension (City and Code) and 2 fact tables. Coupone code is used as primary key for Code_dimension and city_id is used as primary hey for CityDimension table. Relationships are 1 to many. 

 

The issue is the following: each row in OffAdsTable has non null Coupon code, but in some cases channel is missing. Right now with this setup, when I prepare a visual based on Channel from OffAds table and sum(discount_amount) from Coupons split table calculations are wrong as sum(discount amount) is fixed and does not change when I try to change the channel or select several channels. I tried to use bidirectrional filters, but that does not solve my problem.  

 

Ideal solution I would expect will be some measure like Calculate(sum(discount_amount), filter context), which will enable change of calculation based on a column from one fact table to another based on relationships created with coupon code. 

Please let me know if you need clarifications on the issue. 

 

Thanks in advance!

 

Cheers, 

Saro

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Issues with data model and bidirectional filters

Hi @Saro90 ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1596006090613.png

 

Best regards,
Lionel Chen

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

8 REPLIES 8
Highlighted
Super User VII
Super User VII

Re: Issues with data model and bidirectional filters

@Saro90 it will be easier if you share sample data with expected output.






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.





Highlighted
Helper II
Helper II

Re: Issues with data model and bidirectional filters

Hi @parry2k , 

thanks so much for your reply and readiness. Attached you can see the input and expected output as tables with sample data: data_model_1.PNG

 

Thanks again, if you need more input, please let me know!

 

Cheers, 

Saro

Highlighted
Super User VII
Super User VII

Re: Issues with data model and bidirectional filters

@Saro90 try this

 

- relationship between code dimension table with offadd table and couple split table, it will be one to many one on code dimension table, 

- change relationship cross filter direction to both, between code dimension and off add table

- in table visual, drop channel and spending from off ads table and discount from coupon table 

 

and I think that will do it.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos 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.






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.





Highlighted
Helper II
Helper II

Re: Issues with data model and bidirectional filters

@parry2k 

 

thank you so much for your quick reply. I have tried that option. In both cases I see the following error:

 

Error.PNG

Highlighted
Super User VII
Super User VII

Re: Issues with data model and bidirectional filters

@Saro90 seems like there are other tables in the model preventing to set this relationship, I provided the information based on what you showed in excel, remove other relationship for now and test the solution. 

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos 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.

 






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.





Highlighted
Helper II
Helper II

Re: Issues with data model and bidirectional filters

@parry2k 

really appreciate your support. In order to use the workaround you proposed I also need to remove the relationship with City Dimension table which is mentioned as input table in my second message. That is not really desired solution for me as it brakes the logic of whole dashboard. 

 

Any other option I can use for this case by keeping relationship between tables as they are and instead using some Measures?

Highlighted
Super User VII
Super User VII

Re: Issues with data model and bidirectional filters

@Saro90 you can have inactive relationship, and then create a measure use USEREALTIONSHIP function to make inactive relationship to active.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos 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.






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.





Highlighted
Community Support
Community Support

Re: Issues with data model and bidirectional filters

Hi @Saro90 ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1596006090613.png

 

Best regards,
Lionel Chen

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

Helpful resources

Announcements
Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Upcoming Events

Community Summit North America – Join Online!

Join this community-driven Power Platform digital event for unbiased support and problem-solving.

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Top Solution Authors