Forum Discussion

noliverte's avatar
noliverte
Icon for Helper III rankHelper III
6 years ago
Solved

max value in calculated field

Hello,

 

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

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
  • Hi noliverte 

    If my measure will work?

    "compaign" is your "compaign list" table.

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

    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.

11 Replies

  • 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

    • noliverte's avatar
      noliverte
      Icon for Helper III rankHelper III

      Hello,

       

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

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

       

      Noliverte

      • Fowmy's avatar
        Fowmy
        Icon for Super User rankSuper User

        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

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity 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

    • noliverte's avatar
      noliverte
      Icon for Helper III rankHelper III

      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