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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.