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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Kiranbc
Helper I
Helper I

Dax required.

I have a requirement of dax in powerbi where I need count of subjects which have just "not missing" value in result. subjects with missing and not missing should not be counted. Belos is the sample data. I did summarize table but it is not working properly. Please help.

Subject Result
0360129-2001 Not missing
0360129-2002 Not missing
1240004-0001 Not missing
1240004-0002 Not missing
1240004-0003 Not missing
1240004-1001 Not missing
1240004-1006 Not missing
1240004-2001 Not missing
1240023-1002 Missing
1240023-1002 Not missing
1240025-0001 Missing
1240025-0001 Not missing
1240100-0002 Missing
1240100-0002 Not missing
1240100-0003 Missing



1 ACCEPTED SOLUTION
v-junyant-msft
Community Support
Community Support

Hi @Kiranbc ,

Please see is that what you want?
You can use this DAX to create a measure:

SubjectsToExclude = 
CALCULATE(
    DISTINCTCOUNT('Table'[Subject]),
    FILTER(
        ALL('Table'),
        CALCULATE(
            COUNTROWS('Table'),
            'Table'[Result] = "Not missing"
        ) > 0 
        &&
        CALCULATE(
            COUNTROWS('Table'),
            'Table'[Result] <> "Not missing"
        ) = 0
    )
)

And the final output is as below:

vjunyantmsft_0-1709083405987.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

1 REPLY 1
v-junyant-msft
Community Support
Community Support

Hi @Kiranbc ,

Please see is that what you want?
You can use this DAX to create a measure:

SubjectsToExclude = 
CALCULATE(
    DISTINCTCOUNT('Table'[Subject]),
    FILTER(
        ALL('Table'),
        CALCULATE(
            COUNTROWS('Table'),
            'Table'[Result] = "Not missing"
        ) > 0 
        &&
        CALCULATE(
            COUNTROWS('Table'),
            'Table'[Result] <> "Not missing"
        ) = 0
    )
)

And the final output is as below:

vjunyantmsft_0-1709083405987.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.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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