cancel
Showing results for
Did you mean:
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

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
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.

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

Super User III

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

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

5 REPLIES 5
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.

Super User III

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

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

Frequent Visitor

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

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.

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

Frequent Visitor

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

Announcements

#### Welcome to the User Group Public Preview

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

#### 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.