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
mkurup12
Helper I
Helper I

Distinct count when filtered with inactive relationship

Hi!

 

For this dataset, I added in a calendar table (using the calendar function which i called Date[Date]) and the payroll date and the date from the date table have an active relationship. The date in the Dispatch table has an inactive relationship with both payroll date and date table date. In the second screenshot that I provided, I am looking at the information for a single driver for 10/6/2021. This driver only drove one vehicle during that time period but because the dispatch date is not connected with any of the other dates, it is showing that he drove two vehicles (vehicle numbers 1372 and 1545). How would i go about fixing this issue?

 

I used the following formula to get the truck count (which is not accurate. The formula does not work at all when i try to use the userelationship function instead of the crossfilter function):

Truck Count = CALCULATE(DISTINCTCOUNT(DISPATCH[TRUCK_ID]),CROSSFILTER('DISPATCH'[Date],'Payroll Hour Report'[Date],OneWay_RightFiltersLeft),NOT('Payroll Hour Report'[Hours]=0))

 

mkurup12_0-1633701243033.pngmkurup12_1-1633701378643.png

 

Thank you!!

1 REPLY 1
McDermoW5
New Member

Hey @mkurup12

can you send that first screenshot again? I can't seem to read any of the information in any of those tables. Best guess is to use the USERELATIONSHIP() function here to actively specify what relationships you want that measure to use. Also it would be great if you could show me what columns/measures you're using in the table showing the issue just to be clear on what you're wanting to display.

Helpful resources

Announcements
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.