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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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