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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
dan444
Regular Visitor

DAX formula for creating % - similar to SQL join

I am creating a Power BI dashboard based on a PowerApp which saves data to a Sharepoint list. I am calculating all of the metrics for an individual inside the PowerApp, but now need to replicate the same functionality outside of the app.

 

The below PowerApps formula spits out something like this

 

Question_Category Title | Percentage_Assessee

Title 1 | 50%

Title 2 | 62%

Title 3 | 65%

 

It calculates the answers based on a selection of questions (which is based on a "role" selected at the beginning of the app. The question sets are different for each "role").

 

The formula below from PowerApps just divides the sum of the answers by the number of appropriate questions to give the average for that group.

 

I cannot figure out how to replicate this in DAX or in which table to create the measure.

 

"Percentage_Assessee",
        Sum(
            Filter(
                answersc,
                ID in Filter(
                    questions,
                    question_category = SM_Question_Categories[@ID]
                ).ID
            ),
            Switch(
                Value(assessee_answer),
                0,
                0,
                1,
                0.25,
                2,
                0.5,
                3,
                1
            ) / CountIf(
                answersc,
                behaviour_level > 0,
                behaviour_level <= SelectedRole,
                question_category = SM_Question_Categories[@ID]
            )
        ),
1 REPLY 1
v-frfei-msft
Community Support
Community Support

Hi @dan444 ,

 

Could you please share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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