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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.