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

The Fabric Community site will be in read-only mode on Monday, Feb 24 from 12:01 AM to 8 AM PST for scheduled upgrades.

Reply
Anonymous
Not applicable

InActive Relationship in Power BI

I have many tables in my report out of which two tables are used in a chart. One is Date table which contains the date and another is order table which contains the Date, Time and number of orders received for every time.

 

These two tables were given with inactive relationship due to restrictions of having common tables. Now I have a date slicer connected to Date table and another chart which as having time in x axis number of orders received in y axis. 

 

Now to make my chart to get filtered when changing the values in my date slicer. As I said, I have only inactive relationship.

 

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try:

Orders=
CALCULATE(
    SUM(Sales[sales])
    ,USERELATIONSHIP('Date'[Date], Sales[ShipDate])
)

Or:

Orders=
CALCULATE(
    SUM(Sales[sales])
    ,FILTER(Sales, Sales[ShipDate] in VALUES('Date'[Date]))
)

or

Orders= IF(MAX(Sales[ShipDate]) in VALUES('Date'[Date]),
    SUM(Sales[sales]))
   

 

Best Regards,
Liang
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

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try:

Orders=
CALCULATE(
    SUM(Sales[sales])
    ,USERELATIONSHIP('Date'[Date], Sales[ShipDate])
)

Or:

Orders=
CALCULATE(
    SUM(Sales[sales])
    ,FILTER(Sales, Sales[ShipDate] in VALUES('Date'[Date]))
)

or

Orders= IF(MAX(Sales[ShipDate]) in VALUES('Date'[Date]),
    SUM(Sales[sales]))
   

 

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

AllisonKennedy
Super User
Super User

You will need to create a measure, such as:

OrdersByDate = CALCULATE(DISTINCTCount(Orders[orderID]) , USERELATIONSHIP( Orders[date], Date[Date]))


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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