cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Show the proportion of 0s against the total per day on a visual

Hi,

 

Story: I have a 0s and 1s for each day. I would like to visually show the proportion of 0s to the total counts per day on a visual.

 

I created a matrix putting date on rows, the column in question in the "columns" and "values" box. Then I right clicked on the show value as Percent of row total which works perfectly. I need that matrix turned into a visual keeping only the 0s  proportion.percentrow.png

Objective: How can I make a visual that will show case the 0s in % row total exactly as the matrix above. Do I have to create measures for this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Show the proportion of 0s against the total per day on a visual

@RogerSteinberg 

You would yes.  Something list this will get you what you are looking for.

0 pct of total = 
VAR _zeros = 
    CALCULATE(
        COUNTROWS( 'YourTable' ),
        'YourTable'[Value] = 0
    )
VAR _Total =
    COUNTROWS( 'YourTable' )
RETURN 
    DIVIDE ( _zeros, _Total )

Then you put that measure in your chart values along with the date on the axis.

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: Show the proportion of 0s against the total per day on a visual

@RogerSteinberg 

You would yes.  Something list this will get you what you are looking for.

0 pct of total = 
VAR _zeros = 
    CALCULATE(
        COUNTROWS( 'YourTable' ),
        'YourTable'[Value] = 0
    )
VAR _Total =
    COUNTROWS( 'YourTable' )
RETURN 
    DIVIDE ( _zeros, _Total )

Then you put that measure in your chart values along with the date on the axis.

View solution in original post

Re: Show the proportion of 0s against the total per day on a visual

Such a quick and elegant solution, thank you

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 66 members 1,248 guests
Please welcome our newest community members: