Forum Discussion

mikey268's avatar
mikey268
New Member
6 years ago
Solved

LOD Expression from Tableau

hi,

 

I want to create a calculation on top of a LOD expression similar to this.

 

MAXSALES = {Fixed Country : MAX(SALES)} which im doing by

MAXSALES = CALCULATE(MAX('Table1''Sales'),ALLEXCEPT('Table1',Table1[country]))

I want to SUM(MAXSALES) and use it in another calculation to achieve sum(individual sales) / SUM(MAXSALES)

 

Can someone please help.

Thanks in Advance.

  • Hi mikey268 ,

     

    Try this:

    Measure = SUMX(SUMMARIZE('Table'; 'Table'[Quarter]; 'Table'[Part]; "Total"; MAX('Table'[Cost])); [Total])
     

     

5 Replies

  • camargos88's avatar
    camargos88
    Community Champion

    Hi mikey268 ,

     

    You can use CALCULATE(MAX('Table1''Sales'),ALL('Table1')), it will get the max value for this table.

     

    Howerver, it's better if you provide a sample data. So we can check it better.

     

    Ricardo

    • mikey268's avatar
      mikey268
      New Member

      Hi here is the context.

       

      I want to write this in power bi:

       

      SUM({FIXED DIM1, DIM2 : MAX(measure)})

      • camargos88's avatar
        camargos88
        Community Champion

        Hi mikey268 ,

         

        I would say you need to aggregate first with summarize and sum them.

        Can you give some example about it ?