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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
noliverte
Helper III
Helper III

max value in calculated field

Hello,

 

I would like to extract in a specific calculated field the following value (score max)...

tableau-score.png

I extract all my data from google analytics with campaign,goals,sessions,....

 

I want to score all my newletters and I started with the following formula :

score =
var Sobj1=sum(objectifs[objectif 1])
var Sobj2=sum(objectifs[objectif 2])
var Sobj13=sum(objectifs[objectif 13])
var Sobj15=sum(objectifs[objectif 15])
var Sobj16=sum(objectifs[objectif 16])
var Ssession=sum(Campagnes[Sessions])
var Stxrebond=AVERAGE(Campagnes[Bounce Rate])
var ratio_session_rebond=DIVIDE(Ssession,Stxrebond)
var note_all=
(4*(log(IF(Sobj1=0,0.1,Sobj1)) + 1))
+(3*(LOG(IF(Sobj2=0,0.1,Sobj2)) + 1))
+(4*(log(IF(Sobj13=0,0.1,Sobj13)) + 1))
+(4*(log(IF(Sobj15=0,0.1,Sobj15)) + 1))
+(2*(log(IF(Sobj16=0,0.1,Sobj16)) + 1))
+(2*(log(IF(ratio_session_rebond=0,0.1,ratio_session_rebond)) + 1))

 

return note_all
 
How can i extract score max value ?
 
A response would be greatly appreciated
 
Have a good day
 
Noliverte
1 ACCEPTED SOLUTION

Hi @noliverte 

If my measure will work?

"compaign" is your "compaign list" table.

Measure 2 = MAXX(ALLSELECTED(compaign),[score])

Capture8.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

11 REPLIES 11
Greg_Deckler
Community Champion
Community Champion

This looks like a measure aggregation problem. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.

 

Also, could be a Lookup Min/Max situation - https://community.powerbi.com/t5/Quick-Measures-Gallery/Lookup-Min-Max/m-p/985814#M434



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks Greg for your advices.

 

I think my model is maybe different... my measure doesn't exist in a real table, but just in a calculated field.

 

Maybe I have to change my model to include my score in each campaign... or create a new table (campaign/note) based on my visual graphic table on my reports area...

Have a nice day

 

Noliverte

Fowmy
Super User
Super User

@noliverte 

Try a measure like:

MaxMeasure = 
MAXX(
 VALUES(TABLE[CAMPAIGN]),
[score]
)

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

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

Hello,

 

Thanks for your answer, but TABLE[CAMPAIGN] doesn't exist, I just put "graphic table", and simply fill with my data model

champs.png

How can I transform the graphic table in a real table ? Is it possible ?

 

Noliverte

@noliverte 

 

Replace TABLE with your table name CAMPAGNES

 

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

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

Maxx function refer to a real table (i think), when I try this code :

Score_maxx =
MAXX(
VALUES(Campagnes[CAMPAIGN]),
[score]
)
 
Score_max give me the score max of my segment selection...
But I want to have a fix variable the one which is on the top of my graphic table (47)
score_max.png
If I can build a table (new table) with this data, I think your formula will be perfect...
Is it possible ?
 
Noliverte
 

Hi @noliverte 

If this is still a problem, please share a simple sample data without privacy information so i can test and figure out this problem.

 

Best Regards

Maggie

Hello,

 

I've just made a new powerbi file and i simplify sample...

- 3 tables in report graphic view

global.PNG

- relationship between tables

schema.PNG

droite.PNG

- my calculated field formula from score

score = 
var Sobj1=sum(goals[goal1])
var Sobj2=sum(goals[goal2])
var Sobj3=sum(goals[goal3])


var note_all=(2*Sobj1)+(4*Sobj2)+(2*Sobj3)


return note_all

Question :

How can I extract max score value in a specific calculated field ?

 

Do you have an idea ?

 

A response would be appreciated

 

Noliverte

Hi @noliverte 

If my measure will work?

"compaign" is your "compaign list" table.

Measure 2 = MAXX(ALLSELECTED(compaign),[score])

Capture8.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ok I will simplify and post it, thank you.

 

@noliverte 

Yes, it should work.

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

Click on the Thumbs-Up icon on the right if you like this reply 🙂

YouTube, LinkedIn

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors