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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
Super User

@Anonymous 

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


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

CNENFRNL
Community Champion
Community Champion

@Anonymous , 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


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

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
Community Champion
Community Champion

@Anonymous , 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


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Anonymous
Not applicable

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

Fowmy
Super User
Super User

@Anonymous 

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


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

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

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors