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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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