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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
daedah
Helper II
Helper II

sum of countdistrict by day

excuse me, please

I trying to calculate dax formula for districtcount by day

I use formula 

10W = ((CALCULATE(DISTINCTCOUNT(Driver[AUTO_PLATE_ID]),FILTER(Driver,Driver[AUTO_TYPE]="10 W"),Driver[BILL_DATE]))

Result

1574054262821.jpg
but it mistake  it correct is 255 but it show 15
 
Link for raw data 
 
 
Thank you for your help
 
 
 
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @daedah 

I have spent some time on the fixing the outcomes. I am afraid it is not possible to sum up the DistinctCount measure by day. 
Therefore, I figured out an alternative (Calculated Column and Slicer) to your expected results despite the formula does not make much sense: 

 

10W Column=
CALCULATE (
    DISTINCTCOUNT ( Transport[AUTO_PLATE_ID] ),
    FILTER (
        ALLEXCEPT ( Transport, Transport[BILL_DATE] ),
        Transport[AUTO_TYPE] = "10W"
    )
)
    / CALCULATE (
        COUNTROWS ( Transport ),
        FILTER (
            ALLEXCEPT ( Transport, Transport[BILL_DATE] ),
            Transport[AUTO_TYPE] = "10W"
        )
    )

 

44 and 2388 are corresponding to 15 and 255 in your case.  

Capture.JPG

 

Hope it helps you in some extend. 

 

Best regards,

Paul Zheng

 

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi, @daedah 

 

I would like to help you but could you upload your raw data to OneDrive For business if possbile?

 

Paul

Anonymous
Not applicable

Hi, @daedah 

 

The excel data is different to yours, so my results is also differed. For the number "15", it is the distinctcount of Auto_PLATE_ID. 

 

I am not sure about what is the number 255. Could you clarify? Thank you.

 

Best,
Paul

yes please,

1574054262821.jpg

As picture , 255 from  4+8+7+8+11+7+6+7+6+7+8+9+5+5+....  or sum of result in everyday (According time selected , month , year)

 

Thank you for ypur help

Anonymous
Not applicable

Hi, @daedah 

I have spent some time on the fixing the outcomes. I am afraid it is not possible to sum up the DistinctCount measure by day. 
Therefore, I figured out an alternative (Calculated Column and Slicer) to your expected results despite the formula does not make much sense: 

 

10W Column=
CALCULATE (
    DISTINCTCOUNT ( Transport[AUTO_PLATE_ID] ),
    FILTER (
        ALLEXCEPT ( Transport, Transport[BILL_DATE] ),
        Transport[AUTO_TYPE] = "10W"
    )
)
    / CALCULATE (
        COUNTROWS ( Transport ),
        FILTER (
            ALLEXCEPT ( Transport, Transport[BILL_DATE] ),
            Transport[AUTO_TYPE] = "10W"
        )
    )

 

44 and 2388 are corresponding to 15 and 255 in your case.  

Capture.JPG

 

Hope it helps you in some extend. 

 

Best regards,

Paul Zheng

 

Thank you for your help

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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