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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
HariniSheshadri
Frequent Visitor

Need help to convert an excel formula to DAX

Hi,

I am trying to convert the below formula to a DAX calculated column using the mentioned data set. I want to calculate the mean scores for each subsection per user and apply the formula. 

DataSet:

HariniSheshadri_0-1681909952860.png

Formula to be used: 100-((Mean score of subsection for each user *100)/4)

 

Any help would be appreciated in leading me in the right direction, thanks in advance. 

4 REPLIES 4
v-yiruan-msft
Community Support
Community Support

Hi @HariniSheshadri ,

You can create a calculated column as below to get it, please find the details in the attachment.

Column =
VAR _mean =
    CALCULATE (
        AVERAGE ( 'Table'[SubsectionScore] ),
        FILTER ( 'Table', 'Table'[User] = EARLIER ( 'Table'[User] ) )
    )
RETURN
    100 - ( ( _mean * 100 ) / 4 )

vyiruanmsft_0-1682490328960.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HariniSheshadri
Frequent Visitor

Thanks for the response. But this formula dint work. It displays the same value for all the subsections in the list. 

Hi @HariniSheshadri 
Sorry to hear that.
When you said in your original post that you wanted a "DAX calculated colum" did you mean the formula to add a column in "Data View", or did you mean a measure that you could add to a table in "Report View"?

I only ask because I recreated your data as part of making my initial reply and it seemed to work there. Alternatively, perhaps you could share the/a .pbix file so we can see if there's something we hadn't thought about.

Matt

Coriel-11
Resolver I
Resolver I

Hi @HariniSheshadri 

Try this

Formula =
100 - (25*CALCULATE(
    AVERAGE('Delete data'[SubsectionScore]),
    ALLEXCEPT('Delete data', 'Delete data'[User], 'Delete data'[Subsection]))  )
 
Matt

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.