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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
jracer007
Helper IV
Helper IV

Percent of sum votes

Hello,

I have two tables, one has the name of articles and its date of creation. The other table has positive (1) and negative (-1) votes in a single column.
How can I visualize the percentage of positive votes?

powerbi_articles.png

5 REPLIES 5
v-xjiin-msft
Solution Sage
Solution Sage

@jracer007

 

Since you didn't share us your source table structure and some sample data. I assumed your two tables were like this:

 

1.PNG

 

Then to achieve your requirement, we should first create a relationship for the two tables based on Name or something else. Then we can simply create a calculated column with DAX expression to get the percentage of positive votes.

 

We can use expression like following to get Count Total Votes:

Count Total Votes =
CALCULATE (
    COUNT ( Votes[Votes] ),
    FILTER ( Votes, Votes[Name] = EARLIER ( Votes[Name] ) )
)

 

And use this expression to get Count Total Positive Votes:

Count Total Positive Votes =
CALCULATE (
    COUNT ( Votes[Votes] ),
    FILTER ( Votes, Votes[Name] = EARLIER ( Votes[Name] ) && Votes[Votes] > 0 )
)

 

Then simply combine the two expressions to get the percentage:

Percentage of Positive Votes =
CALCULATE (
    COUNT ( Votes[Votes] ),
    FILTER ( Votes, Votes[Name] = EARLIER ( Votes[Name] ) && Votes[Votes] > 0 )
)
    / CALCULATE (
        COUNT ( Votes[Votes] ),
        FILTER ( Votes, Votes[Name] = EARLIER ( Votes[Name] ) )
    )

2.PNG

 

If above sample doesn't satisfy your requirement, please kindly share us more information like some sample data and your desired result.

 

Thanks,
Xi Jin.

 

DAX comparison operations do not support comparing values of type Text with values of type Integer. Consider using the VALUE or FORMAT function to convert one of the values.

@jracer007

 

Did you mean the Votes in your source table is Value column? If so, you can modify the expression like this:

 

Percentage of Positive Votes =
CALCULATE (
    COUNT ( Votes[Votes] ),
    FILTER ( Votes, Votes[Name] = EARLIER ( Votes[Name] ) && Votes[Votes] = "Positive" )
)
    / CALCULATE (
        COUNT ( Votes[Votes] ),
        FILTER ( Votes, Votes[Name] = EARLIER ( Votes[Name] ) )
    )

 

Thanks,
Xi Jin.

This is the tables.

power bi12.pngpower bi13.png

@jracer007

 

Have you tried my solution? Does it work for you?

 

If it doesn't work for you, please feel free to tell my where the issue is. And since you have shared your sample data, please also share us your desire result based on the sample data and the logic to achieve your result. So that we will have the right direction.

 

Thanks,
Xi Jin.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors