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
Cactus266
New Member

Userelationship() and filtering from fact table

Hello, I have a start schema data model, date table and fact table have multiple inactive relationships, one of them is active. In fact table I have data about ticket: ticketid, creationDate, closeDate etc. CreationDate is active relationship, closeDate is inactive relationship. I need to have slicers YearMonth (coming from Date table) and TicketID (coming from fact table). If I filter, YearMonth=202005, the result of measure is 1 CALCULATE(COUNTROWS(Fact), USERALATIONSHIP(Fact[CloseDate],Date[Date]), which is correct But in the filters for ticketID I see nothing. How to set this up to have ticketid=234 in the slicer?

 

Source:

ticketId | creationDate | closeDate

123 | 02.02.2020 | 04.04.2020

234 | 03.04.2020 | 05.05.2020

 

Result:

YearMonth| TicketID |Close

202005 |234|1

 

Any thoughts?

1 ACCEPTED SOLUTION

Hi @Cactus266 ,

 

Because you have active relationship between fact table and date table. Once you select 202005 in slicer there's no data have creation date in 202005, so the ticket slicer will be blank.

If you want the slicer won't be affected by yearmonth slicer, you can edit the interaction by select the yearmonth slicer and click edit interaction feature under Format menu.

2.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

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

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@Cactus266 , refer if this blog can help

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

Just check dates are identified as the date and have no timestamp, Change format to include time and check.

 

If it has a timestamp, then create a date filed like given below and use that in join

 

Close = [close date].date

@amitchandak, it is just date column type

@Cactus266 , are you getting data when there is no filter with year

 

@amitchandak

Here how does it look in Power BI, I am receiving expected results. But tickets are gone in TicketID filter.

Capture.PNG

@Cactus266 , create a separate dimension/table for Ticket No. or diable interactions 

https://docs.microsoft.com/en-us/power-bi/service-reports-visual-interactions

@amitchandak, creating separate dimension table just for ticketId will duplicate the data. What means diable interaction?

I need to filter by ticketId.

Hi @Cactus266 ,

 

Because you have active relationship between fact table and date table. Once you select 202005 in slicer there's no data have creation date in 202005, so the ticket slicer will be blank.

If you want the slicer won't be affected by yearmonth slicer, you can edit the interaction by select the yearmonth slicer and click edit interaction feature under Format menu.

2.PNG

 

Best Regards,

Jay

 

Community Support Team _ Jay Wang

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

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

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.

Top Solution Authors