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.
Hi Dear Community Experts,
will be very grateful for any advice you can share on the issue based on the following data model:
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
Solved! Go to Solution.
Hi @Anonymous ,
Please refer to my .pbix file.
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.
@Anonymous it will be easier if you share sample data with expected output.
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.
Hi @parry2k ,
thanks so much for your reply and readiness. Attached you can see the input and expected output as tables with sample data:
Thanks again, if you need more input, please let me know!
Cheers,
Saro
@Anonymous 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.⚡
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.
thank you so much for your quick reply. I have tried that option. In both cases I see the following error:
@Anonymous 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.⚡
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.
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?
@Anonymous 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.⚡
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |