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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Dax Statement to Dax Expression

Hi

 

The below statement works in Dax Studio but I cannot get it to work as a Dax expression in Power Bi:

DEFINE  
VAR Category =  
SUMMARIZECOLUMNS(  
DSM_Store_Visits[Category Label],
DSM_Store_Visits[Group Label],
"Total Rating"
CALCULATE(sum(DSM_Store_Visits[Actual])/sum(DSM_Store_Visits[Total Score])
)
)
  
EVALUATE
GROUPBY(  
Category,
DSM_Store_Visits[Group Label],
//DSM_Store_Visits[Category Label],
"Max Sales", averagex(CURRENTGROUP(),[Total Rating])  
)

How would I get this too work?

Thanks

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Thanks for reaching out to us.

I just want to confirm if you resolved this issue? If yes, you can accept the answer helpful as the solution or share you method and accept it as solution, thanks for your contribution to improve Power BI.

If you need more help, please let me know.

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , In case new table

 

New Table =
VAR Category =
SUMMARIZECOLUMNS(
DSM_Store_Visits[Category Label],
DSM_Store_Visits[Group Label],
"Total Rating",
CALCULATE(sum(DSM_Store_Visits[Actual])/sum(DSM_Store_Visits[Total Score])
)
)

return
GROUPBY(
Category,
DSM_Store_Visits[Group Label],
//DSM_Store_Visits[Category Label],
"Max Sales", averagex(CURRENTGROUP(),[Total Rating])
)

 

 

Or a measure

 

New measure=
VAR Category =
ADDCOLUMNS(Summarize(DSM_Store_Visits, DSM_Store_Visits[Category Label], DSM_Store_Visits[Group Label]), "Total Rating",
CALCULATE(sum(DSM_Store_Visits[Actual])/sum(DSM_Store_Visits[Total Score]) ) )

return averagex(Summarize(Category, [Group Label]),[Total Rating])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.