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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Jop1235123
Frequent Visitor

Can't create a direct active relationship ... ambiguity between tables (Date table)

Hi all, 

 

For one of my dashboards i created the following model:

Jop1235123_2-1710168044989.png

Planned terms and invoices are connected with orders with the column 1. ordernumber.

Beside that the terms and invoices tables are connected with the date table.

For one of my 'table overview' i want to connect orders with the date table. I have a slicer which shows the bookyears and i want to filter the 'order overview' in my dashboard based on the year ready. The result i want to show is a table which only shows the orders ready in the selected year with the slicer. This is of course not possible because of the already established relations between the tables (ambiguity between tables). I can't connect the order overview with the terms or invoice table because this are no dimension tables. 

Someone got a good solution for this? 

 

Thx in advance.

 

Jop 

 

 

1 ACCEPTED SOLUTION
Sahir_Maharaj
Super User
Super User

Hello @Jop1235123,

 

Can you please try the following:

 

1. Use Userelationship in Your Measures

SumOfOrdersByYearReady = 
CALCULATE(
    SUM(Orders[OrderValue]),
    USERELATIONSHIP(Orders[YearReady], 'Date'[Date])
)

2. Creating a Disconnected Slicer Table

YearTable = DISTINCT ( SELECTCOLUMNS ( 'Date', "Year", YEAR('Date'[Date]) ) )

Then, you can use a measure to filter the orders based on the selected year from this new slicer

SelectedYear = SELECTEDVALUE ( YearTable[Year] )

OrderValueByYear = 
CALCULATE (
    SUM ( Orders[OrderValue] ),
    FILTER (
        ALL ( 'Date' ),
        YEAR ( 'Date'[Date] ) = [SelectedYear]
    )
)

Use this new measure in your visual instead of the direct column from the 'Date' table.

 

Hope this helps.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 13K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

View solution in original post

5 REPLIES 5
Sahir_Maharaj
Super User
Super User

Hello @Jop1235123,

 

Can you please try the following:

 

1. Use Userelationship in Your Measures

SumOfOrdersByYearReady = 
CALCULATE(
    SUM(Orders[OrderValue]),
    USERELATIONSHIP(Orders[YearReady], 'Date'[Date])
)

2. Creating a Disconnected Slicer Table

YearTable = DISTINCT ( SELECTCOLUMNS ( 'Date', "Year", YEAR('Date'[Date]) ) )

Then, you can use a measure to filter the orders based on the selected year from this new slicer

SelectedYear = SELECTEDVALUE ( YearTable[Year] )

OrderValueByYear = 
CALCULATE (
    SUM ( Orders[OrderValue] ),
    FILTER (
        ALL ( 'Date' ),
        YEAR ( 'Date'[Date] ) = [SelectedYear]
    )
)

Use this new measure in your visual instead of the direct column from the 'Date' table.

 

Hope this helps.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution?
➤ Lets connect on LinkedIn: Join my network of 13K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Thank you once again for the great assistance Sahir! Fixed the issue. 

v-jialongy-msft
Community Support
Community Support

Hi @Jop1235123 

 

Hope the following methods can solve your problem:

 

You can create a separate date table specifically for the 'orders' table. This table would only include dates relevant to orders and could be linked directly to the 'orders' table. This allows you to filter orders by book year without interfering with the existing relationships between other tables.

 

 

 

 

Best Regards,

Jayleny

 

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

 

 

 

 

 

 

 

Hi Jayleny,

 

Thanks for your reaction. 

This isn't the solution i am looking at. I am filtering with a year slicer and it has to interact with all the overviews on my dashboard. Otherwise i have to make 2 year slicers next to each other. I want one year slicer connected to all my overviews on the page. 

I would argue that orders and invoices are independent facts and should not be connected directly. Instead, orders should be connected to the calendar, and the invoices for an order can be accessed via TREATAS.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.