cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mdrapal
Regular Visitor

How to get a % of blanks vs nonblanks in a table

I want to get a % of filled rows vs blank rows. 

This is to get a compliance check, where we need to be able to click on the total % blanks at the bottom and get them to filter on those rows, 

I have a table with a lot of columns so ideally I'm looking for something that can be easily copied to other columns.

e.g.

CountyTransmission number
 5555
London4465
Dublin 
67%67%
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: How to get a % of blanks vs nonblanks in a table

Hi @mdrapal 

If you have many columns, for example

Capture13.JPG

 

In my method,

i open Edit queries, copy the original table,

In the "Table copy",

add an index column from 1,

delete "change type" step from the right step pane,

then select "index" column, next select "Unpivot other columns",

Capture14.JPG

Close&&apply

 

Create measures in "Table copy"

all count = CALCULATE(COUNTA('Table copy'[Value]),ALLEXCEPT('Table copy','Table copy'[Attribute]))

blank count =
IF (
    CALCULATE (
        COUNTBLANK ( 'Table copy'[Value] ),
        ALLEXCEPT ( 'Table copy', 'Table copy'[Attribute] )
    )
        = BLANK (),
    0,
    CALCULATE (
        COUNTBLANK ( 'Table copy'[Value] ),
        ALLEXCEPT ( 'Table copy', 'Table copy'[Attribute] )
    )
)


blank% = [blank count]/[all count]

no blank% = ([all count]-[blank count])/[all count]

Measure = IF(ISINSCOPE('Table copy'[Index]),MAX('Table copy'[Value]),FORMAT([no blank%],"0.00%"))

Capture15.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
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

4 REPLIES 4
Community Support
Community Support

Re: How to get a % of blanks vs nonblanks in a table

Hi @mdrapal 

It is not clear for me.

click on the total % blanks at the bottom and get them to filter on those rows?

something that can be easily copied to other columns?

The screenshot?

 

Could you clear me so to find a solution for you?

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Highlighted
mdrapal
Regular Visitor

Re: How to get a % of blanks vs nonblanks in a table

Hi Maggie, 

I want to be able to drillthrough to underlying table data to see the blank cells.

The screenshot is hwat we expect to see but I dont get that at all,

I just get a table with no sums,

and I want to sum all the blanks in the column and get the % of the cells blank vs cells filled. 

Is that more clear?

Community Support
Community Support

Re: How to get a % of blanks vs nonblanks in a table

Hi @mdrapal 

If the columns are not too many, you could create measures to show each columns' blank row rate.

Create measures

Measure_country =
VAR val =
    (
        CALCULATE ( COUNTROWS ( 'Table' ), ALL ( 'Table' ) )
            - CALCULATE ( COUNTBLANK ( 'Table'[County] ), ALL ( 'Table' ) )
    )
        / CALCULATE ( COUNTROWS ( 'Table' ), ALL ( 'Table' ) )
RETURN
    IF (
        ISINSCOPE ( 'Table'[Index] ),
        MAX ( 'Table'[County] ),
        FORMAT ( val, "0.00%" )
    )

Measure_number =
VAR val =
    (
        CALCULATE ( COUNTROWS ( 'Table' ), ALL ( 'Table' ) )
            - CALCULATE ( COUNTBLANK ( 'Table'[Transmission number] ), ALL ( 'Table' ) )
    )
        / CALCULATE ( COUNTROWS ( 'Table' ), ALL ( 'Table' ) )
RETURN
    IF (
        ISINSCOPE ( 'Table'[Index] ),
        MAX ( 'Table'[Transmission number] ),
        FORMAT ( val, "0.00%" )
    )

Capture5.JPG

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Community Support
Community Support

Re: How to get a % of blanks vs nonblanks in a table

Hi @mdrapal 

If you have many columns, for example

Capture13.JPG

 

In my method,

i open Edit queries, copy the original table,

In the "Table copy",

add an index column from 1,

delete "change type" step from the right step pane,

then select "index" column, next select "Unpivot other columns",

Capture14.JPG

Close&&apply

 

Create measures in "Table copy"

all count = CALCULATE(COUNTA('Table copy'[Value]),ALLEXCEPT('Table copy','Table copy'[Attribute]))

blank count =
IF (
    CALCULATE (
        COUNTBLANK ( 'Table copy'[Value] ),
        ALLEXCEPT ( 'Table copy', 'Table copy'[Attribute] )
    )
        = BLANK (),
    0,
    CALCULATE (
        COUNTBLANK ( 'Table copy'[Value] ),
        ALLEXCEPT ( 'Table copy', 'Table copy'[Attribute] )
    )
)


blank% = [blank count]/[all count]

no blank% = ([all count]-[blank count])/[all count]

Measure = IF(ISINSCOPE('Table copy'[Index]),MAX('Table copy'[Value]),FORMAT([no blank%],"0.00%"))

Capture15.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
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

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors