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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.