Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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?
Since you didn't share us your source table structure and some sample data. I assumed your two tables were like this:
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] ) ) )
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.
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.
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.