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
Applicable88
Impactful Individual
Impactful Individual

Disregard the blanks when of another field when distinctcount

Hello,

I use following measure to distinctcount the transportorders

 

Measure = Calculate ( distinctcount( 'Transporttable'transportorders), 'Transporttable' duration<60 )

 

Unfortunately it also counts the blank() values in duration liker ordernumber 1234:

Orders Duration Count Intervall
1234   1
1235 14 1
1236 12 1
1237 55 1
1238 44 1
1239 33 1
1240 56 1
1241 34 1
1242 22 1
1243 13 1
1244 18 1
1245 888 0
1246 888 0
1247 678 0
1248 545 0

 

how to disregard the duration with blank field? 

I tried following with no success:

Measure = Calculate ( distinctcount( 'Transporttable'transportorders), 'Transporttable' duration<60 && 'Transporttable' duration<> blank() )

 

But with that I got a totally different value.

Hope someone knows my mistake.

 

Thank you very much in advance.

Best. 

 

 



2 ACCEPTED SOLUTIONS

Yes, right.

Measure = 
CALCULATE( 
    Countrows(DISTINCT('Table'[Órdenes])),
    FILTER('Table',
    'Table'[Duración] <> BLANK()
        && 'Table'[Duración] < 60
    )
)

Prove it in this data:

Ivancito111_0-1639423907295.png

and the value was still 10.

If this post answers your question, please mark as "Accept as a solution" so that other people can also access it.

Best regards

Ivancito

View solution in original post

Applicable88
Impactful Individual
Impactful Individual
4 REPLIES 4
Applicable88
Impactful Individual
Impactful Individual
Syndicate_Admin
Administrator
Administrator

Hello, good afternoon, if I understand correctly, this measure will help you solve your problem.

Measure = 
COUNTROWS(
    FILTER('Table',
    'Table'[Duración] <> BLANK()
        && 'Table'[Duración] < 60
    )
)

This is the result that gave me the account:

Ivancito111_0-1639423087348.png

If this post answers your question, please mark as "Accept as a solution" so that other people can also access it.

Best regards

Ivancito

Hi @Syndicate_Admin thanks so much so far, but is there a way to include counting distinct orders? some can be double sometimes. 

And why  that part doesn't work out?

Measure = Calculate ( distinctcount( 'Transporttable'transportorders), 'Transporttable' duration<60 && 'Transporttable' duration<> blank() )

 

Yes, right.

Measure = 
CALCULATE( 
    Countrows(DISTINCT('Table'[Órdenes])),
    FILTER('Table',
    'Table'[Duración] <> BLANK()
        && 'Table'[Duración] < 60
    )
)

Prove it in this data:

Ivancito111_0-1639423907295.png

and the value was still 10.

If this post answers your question, please mark as "Accept as a solution" so that other people can also access it.

Best regards

Ivancito

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.

Users online (4,055)