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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
mina97
Helper III
Helper III

count the number of applications

i have the following data

orderstauts
216submited
216accepted
217submited
217resumited
217accepted

 

i need to count the number of orders that got accepted without being reaplied so in this case it should give one order 
i wrote the following dax but it is NOT helping

AcceptedOrdersWithoutResubmit = 
CALCULATE(
    COUNTROWS('Table'),
    FILTER(
        'Table',
        'Table'[stauts] = "accepted" &&
        NOT (
            CALCULATE(
                COUNTROWS('Table'),
                FILTER(
                    'Table',
                    'Table'[order] = EARLIER('Table'[order]) &&
                    'Table'[stauts] = "resumited"
                )
            ) > 0
        )
    )
)

please help and thank you 

1 ACCEPTED SOLUTION

Hi, @mina97 ,

The following DAX might work for you:

 

UniqueOrdersCount = COUNTROWS(VALUES('Table(2)'[order]))

 

The final output is shown in the following figure:

vjunyantmsft_0-1698124543180.png

Best Regards,

Dino Tao

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

View solution in original post

6 REPLIES 6
v-junyant-msft
Community Support
Community Support

Hi @mina97 ,

The following DAX might work for you:

AcceptedOrdersWithoutResubmit =
COUNTROWS(
    FILTER(
        'Table',
        'Table'[status] = "accepted" &&
        NOT(
            CALCULATE(
                COUNTROWS('Table'),
                FILTER('Table', 'Table'[status] = "resumited"),
                ALLEXCEPT('Table', 'Table'[order])
            ) > 0
        )
    )
)

The final output is shown in the following figure:

vjunyantmsft_0-1698113089869.png

Best Regards,

Dino Tao

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

hey can you make it count the unique numbers order 

because i have other status and i do not want it to count them fore xample 

216Sumbit
216Review
216Paid
216Approved

the dax counted this as 4 😞 please help 

Hi, @mina97 ,

The following DAX might work for you:

 

UniqueOrdersCount = COUNTROWS(VALUES('Table(2)'[order]))

 

The final output is shown in the following figure:

vjunyantmsft_0-1698124543180.png

Best Regards,

Dino Tao

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

it should be 1 

mina97
Helper III
Helper III

wrong it gived zero 😞

Dangar332
Super User
Super User

Hi, @mina97 

try below just adjust your table aand column name 

final =
var a = DISTINCTCOUNT('practice'[order])
var b = CALCULATE(DISTINCTCOUNT('practice'[order]),practice[status]="resumited")
return a-b
 
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. and don't forget to give kudos

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.