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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Womkas_90
Regular Visitor

DAX: how to count distinct date events where correlated columns are not blank?

Hello dear Community,

 

im pretty new to PowerBI and DAX and i have a particular Problem i cant solve.

I wanted to create a Measure which counts the distinct Date events, where units where sold. Therefore i am Expecting 2, because there are 3 Dates where stuff is sold, but the 01.12.2020 units sold value is blank.

 

 

Customer IDOrder IDProductUnits SoldDateRevenueCost
2183779Oatmeal Raisin 01.12.202030751353
3580583Oatmeal Raisin 01.12.202095804215.2
2707082Oatmeal Raisin 01.12.202062502750
2734809Oatmeal Raisin        1'23601.11.202061802719.2
2544809Oatmeal Raisin           94101.11.202047052070.2
3170867Oatmeal Raisin        1'14301.10.202057152514.6
4131700Oatmeal Raisin        1'26901.10.202063452791.8

 

Therefore i tried the following Measure: 

 

countdistinctdays = CALCULATE(DISTINCTCOUNT(Orders[Date].[Date]);'Orders'[Units Sold] = BLANK())

 

But what comes out is gibberish. Can someone help me here? I think i havent understood something fundamental in PowerBI.

 

 

Thank you very much!!! P.S. sorry for my english.

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Womkas_90 
Please try 

=
COUNTROWS (
    FILTER (
        VALUES ( Orders[Date] ),
        CALCULATE ( SUM ( Orders[Units Sold] ) ) <> BLANK ()
    )
)

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @Womkas_90 

 

You can also try the following methods.

countdistinctdays =
CALCULATE (
    DISTINCTCOUNT ( Orders[Date] ),
    FILTER ( ALL ( Orders ), 'Orders'[Units Sold] <> BLANK () )
)

vzhangti_0-1662534516689.png

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

tamerj1
Super User
Super User

Hi @Womkas_90 
Please try 

=
COUNTROWS (
    FILTER (
        VALUES ( Orders[Date] ),
        CALCULATE ( SUM ( Orders[Units Sold] ) ) <> BLANK ()
    )
)

Yes it works, thank you so much!!!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.