cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HectorEscalante
Frequent Visitor

Sum all comtens in multiple columns

Hi everyone im new in powerbi and Dax funtions
I trying to merge or sum all contents in multiple columns the divide from total of participants all the participants has multiple answers
Like the next image in excel using count.if and counta funtions
buscar.png

y try with the next messure: 

Dog = var DOGS = COUNTROWS(FILTER(Pets,Pets[Pet1] = "Dog")) +
COUNTROWS(FILTER(Pets,Pets[Pet2] = "Dog")) +
COUNTROWS(FILTER(Pets,Pets[Pet3] = "Dog")) +
COUNTROWS(FILTER(Pets,Pets[Pet4] = "Dog")) +
COUNTROWS(FILTER(Pets,Pets[Pet5] = "Dog")) +
COUNTROWS(FILTER(Pets,Pets[Pet6] = "Dog"))

Var totalPets = COUNTA(Pets[Participants])
return DIVIDE(DOGS,totalPets)

But this only work for "Dog" then made multiple measure for all the pets in my table and i couldn't graph all the measures in the same graph, there is a better? 

And tnx for the help

Hector Escalante
2 ACCEPTED SOLUTIONS
Fowmy
Super User IV
Super User IV

@HectorEscalante 

You can unpivot the table in Power Query and the rest is easy. Please find attached the Power BI file below my signatire.

Fowmy_0-1619904614027.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Blog - Data Visualization

Website   YouTube    LinkedIn   PBI User Group

View solution in original post

CNENFRNL
Super User III
Super User III

@HectorEscalante , first of all, you might want to try transforming the dataset into a flat table,

Screenshot 2021-05-01 232811.png

then, you can author different measures to conduct different analyses.

Screenshot 2021-05-01 233220.png

View solution in original post

5 REPLIES 5
HectorEscalante
Frequent Visitor

I try to upload my pbi file but i cant, unpivot my columns makes me error with other graphs and messure, let you below in the image and the data i use, and ty again everyone.

 

HectorEscalante_0-1619911150205.png

 

 

CNENFRNL
Super User III
Super User III

@HectorEscalante , first of all, you might want to try transforming the dataset into a flat table,

Screenshot 2021-05-01 232811.png

then, you can author different measures to conduct different analyses.

Screenshot 2021-05-01 233220.png

View solution in original post

I try to un pivot column but change my other messures can you check my replay pliz

Fowmy
Super User IV
Super User IV

@HectorEscalante 

You can unpivot the table in Power Query and the rest is easy. Please find attached the Power BI file below my signatire.

Fowmy_0-1619904614027.png

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Blog - Data Visualization

Website   YouTube    LinkedIn   PBI User Group

View solution in original post

Works! ty but change my other messures and change my other data analysis, can you check my replay! pliz

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors