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

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.

Reply
HarrisonBi
Frequent Visitor

How to filter visuals correctly when using multiple dates

Hi,

 

I would like to know how (if possible) I can filter visuals correctly when I am using multiple dates. I will explain my situation below:

 

I have a date table and a sales table. These two tables are related by Date[Date] and Sales[InvoiceDate] as I usually report sales based on the invoice date and this has worked fine. 

 

However, on the sales table there is also another date called CreationDate, I would now like to see all my sales broken down by the creation date. So what I have done is, created an inactive relationship between Date[Date] and Sales[CreationDate] and created a measure 

CALCULATE(Sales[SalesTotal],

USERELATIONSHIP('Date'[Date],Sales[CreationDate]))

This works and I am able to use various columns from the date table (i.e. Financial Year) and see my sales according to the CreationDate - I have this displayed in a matrix.
 
However the problem I am facing is - if I click a month in the matrix, all the other visuals on the page are filtering the results based on the InvoiceDate NOT the CreationDate. I believe this is because the active relationship between the two tables is based on InvoiceDate.
 
How can I make the other visuals filter based on CreationDate when clicking a month in my matrix ?
 
Thanks
2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

I think you will have to rewrite all the measures with the USERELATIONSHIP() function.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@HarrisonBi , When you filter months from the date table. Visual using USERELATIONSHIP('Date'[Date],Sales[CreationDate]) will filter on Creation date.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.