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.
Hello Everyone,
I am trying to use an inactive relationship to fill gaps in my data. I have a fact table and a dimension table. There are two relationships, 1 active and 1 inactive, pictured below:
In my data table (Data), there are 2 columns: Contract # and Contract Collective #. My Dimension table (Contract Header) is joined to the Contract # so I can pull in the customer and vendor information associated with the Contract #. The combined data looks like the left table below (right table is my dimension table):
Note how on the bottom row, the Contract # and Contract Collective # don't match. What I want to do is that when the Contract # and Contract Collective # don't match and a null is returned for the vendor, I want to use the inactive relationship (which is based on Contract Collective #) to return the vendor for the Contract Collective # (which would be Samm's Club in this case). Can anyone help with this?
@Anonymous good to hear, I would recommend pasting the solution so that others I can get help from it.s
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.
@Anonymous share using one drive/google drive
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.
It's all good, I found a solution!
@Anonymous add a new column like this as an example for a vendor.
In my example, the Customer represents your Contract Header table and the Table represents your data table.
Vendor 1 =
VAR __vendor = RELATED ( Customer[Vendor] )
VAR __vendorIfBlank =
IF ( COALESCE( __vendor, "" ) = "",
MAXX (
Customer,
CALCULATE (
MAX ( Customer[Vendor] ),
USERELATIONSHIP ( Customer[Column1], 'Table'[Col2] )
)
),
__vendor
)
RETURN __vendorIfBlank
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!
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.
I tried it, and I was unable to use COALESCE so I just used ISBLANK instead. This is what happened when I tried it:
I changed my data table titles to match your use of them
Hi @Anonymous,
For your scenario, I think it may cause the 'circular dependency' reference issue due to the two relationships(activated and inactivated) mapping conflict.
In my opinion, I'd like to suggest you use all functions to ignore the filter and manually apply the filter to your expressions, it may avoid the 'circular dependency' issue.
Managing “all” functions in DAX: ALL, ALLSELECTED, ALLNOBLANKROW, ALLEXCEPT
Regards,
Xiaoxin Sheng
how so?
Hi @Anonymous,
Can please share a pbix file with some dummy data with a similar data structure as the raw table structures? It should help us clarify your scenario and test to coding formula.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
How do I add a file? I have a pbix, but I don't see an option to share it?
HI @Anonymous,
You can upload your file to onedrive for business and share the link here.
Notice: do not attach sensitive in the sample file.
Regards,
Xiaoxin Sheng
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 |
---|---|
110 | |
99 | |
80 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
93 | |
84 | |
66 |