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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
agcruz
Frequent Visitor

Handling Multiple Selection Values in Power BI DAX

I have a survey with 3 questions. 2 of which are "Yes" and "No" questions, while one is a multiple choice (can have more than one selection) question where the answer only counts as "Yes" if all four choices are selected. Create Power BI DAX formulas on how to calculate the % of "Yes" answers per question out of all distinct users.

 

Dividing by distinct users will not work as this survey is 1 out of 3 surveys in my table and each survey will have different users who answered them.

 

Sample Table:

UserSurvey No.Question No.Answer
111Yes
112Yes
113Option 1
113Option 2
113Option 3
113Option 4
211Yes
212No
213Option 1
321Yes
322No

 

Expected % Yes:
Survey 1, Question 1: 100%
Survey 1, Question 2: 50%
Survey 1, Question 3: 50%
Survey 2, Question 1: 100%
Survey 2, Question 2: 0%

1 ACCEPTED SOLUTION
ThxAlot
Super User
Super User

Survey.pbix

 

ThxAlot_0-1689218889395.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



View solution in original post

2 REPLIES 2
ThxAlot
Super User
Super User

Survey.pbix

 

ThxAlot_0-1689218889395.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



Thank you so much! This worked like a charm 😊

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors