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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ksball13
New Member

New User- DAX Question

Hi, I am relatively new to Power BI and am working on some reports for my company:

 

We are a freight company and we measure activity (loads moved) based on Pickup Date.  

 

In my data table, each load  has a Customer attached to it.   For that Customer there is an associated  record for "First Load Moved date" and "Sales Rep"

 

Over a given period of time in my slicer (Pickup Date being the time), I want to know how many New Customers a Sales Rep earned.   Specifically, how many Customers had their "First Loads Moved Date" within the time period that I am measuring (related to the Pickup Date.).

 

I am struggling with figuring out a DISTINCTCOUNT function that ties it together and would love any help.

 

 

1 ACCEPTED SOLUTION
harshnathani
Community Champion
Community Champion

Hi @ksball13 ,

 

 

Try this measure.

 

Measure = 
CALCULATE (
    DISTINCTCOUNT ( 'Table'[CustomerID] ),
    FILTER (
      Dates,
        Dates[Date] >= MIN( 'Table'[PickupDate] )
            && Dates[Date] <= MAX ( 'Table'[PickupDate] )
    )
)

 

Incase it does not work, please share sample data and your expected output.

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

We'd love to help you but first you need to be more specific...

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Best
D
harshnathani
Community Champion
Community Champion

Hi @ksball13 ,

 

 

Try this measure.

 

Measure = 
CALCULATE (
    DISTINCTCOUNT ( 'Table'[CustomerID] ),
    FILTER (
      Dates,
        Dates[Date] >= MIN( 'Table'[PickupDate] )
            && Dates[Date] <= MAX ( 'Table'[PickupDate] )
    )
)

 

Incase it does not work, please share sample data and your expected output.

 


Regards,

Harsh Nathani


Appreciate with a Kudos!! (Click the Thumbs Up Button)

Did I answer your question? Mark my post as a solution!

 

 

@harshnathani 

 

That DID work once I replaced Dates[Date] with my "first load moved" date.   Thank you so much!

 

Follow up question: 

 

Let's say I have two levels of Sales Person.   I call them "Account Rep" and "BDM"   

 

In many cases, the  Customer has a BDM and an Account Rep.   Many times the BDM and the Account Rep have the same value (it is the same person acting in both capacities).  

 

I then want to take my new field and break that down into two measures:

 

1. New Customers Added when the AR and the BDM are the same.

2.  New Customers Added when the AR and the BDM are different.

 

How would I go about creating those measures?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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