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
Matt_Mohawk
Helper II
Helper II

Distinct Job Count based on Start Date

Hi,

 

I need to get a distinct count of jobs based on Entered Date. This is the day that it was entered into our systems. For some reason, the data that shows is only working based on Start Date for each revision to the Job. January should have a distinct count of 22 but I am getting way more than that. I can send a pbix file if needed.

 

Matt_Mohawk_0-1671549525371.png

 

Matt_Mohawk_1-1671549901290.png

 

@amitchandak 

4 REPLIES 4
Mikelytics
Resident Rockstar
Resident Rockstar

Hi @Matt_Mohawk 

 

Then I am pretty sure its because of your data model. Do you have an relation between the ENtry column and the date column of your data table? If not then this is the issue. You have to create the connection. As a result it should look like this

Mikelytics_0-1671551967129.png

the highlighted line is a inactive relationship.

 

Now you have to add in the emasure the USERELATIONSHIP function

Number of jobs =
VAR __MinDate = MIN(DimDate[Date])
RETURN
CALCULATE(
   DISTINCTCOUNT(FactTable[JobNumberColumn]),
   DimDate[Date] >= __MinDate,
   USERELATIONSHIP(DimDate[Date],FactTable[EntryColumn])
)

 

Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your thumbs up!
@ me in replies or I'll lose your thread.

 

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

I currently have a relationship built for every table that I currently use. I use the Date Out field for that table because I have other data that I have to display other than what I had provided you. See image below to see the Relationship area.

 

Matt_Mohawk_0-1671553378279.png

 

Mikelytics
Resident Rockstar
Resident Rockstar

HI @Matt_Mohawk 

 

Please try the following

Number of jobs =
VAR __MinDate = MIN(DimDate[Date])
RETURN
CALCULATE(
   DISTINCTCOUNT(FactTable[JobNumberColumn]),
   DimDate[Date] >= __MinDate
)
   

 

Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your thumbs up!
@ me in replies or I'll lose your thread.

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

@Mikelytics ,

 

Thank you for responding so quickly. I am still getting the same number. I have pasted an image below of the formula I created. Is it set up correctly?

 

Matt_Mohawk_0-1671550680733.png

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.