Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Pivot Table Target Measure

Hi guys... I need your help with a measure in Pivot Table with Excel.

 

My goal is to have a measure (DisplayTotalWeeks) based on qty of "SemanaMes". In the case, it must return 9 like the example below.

Something like that:

 

Criada em (Month) SemanaMes Qty Atividade DisplayTotalWeeks

abr14469
abr2119
abr319
abr439
abr519
mai15249
mai27019
mai319
mai429
Grand Total 16909

 

I have stressed ChatGPT, but it doesn't give me what I'm looking for.

As an example, I have try this from GPT:
TotalUniqueWeeks := COUNTROWS(SUMMARIZE('YourTable', 'YourTable'[SemanaMes]))
DisplayTotalWeeks := CALCULATE([TotalUniqueWeeks], ALL('YourTable'))
It doesn't return 9, that what I was expecting.

So, you are my last hope.

4 Replies

  • DimaMD's avatar
    DimaMD
    Solution Sage

    Anonymous  Hi, you need to add another column to the TotalUniqueWeeks measure, Is this your desired outcome?

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi DimaMD ,

       

      I have had try that, but I got this one:


      Criada em (Month) | SemanaMes | Qty Atividade | measure 2

      abr14465
      abr2115
      abr315
      abr435
      abr515
      mai15245
      mai27015
      mai315
      mai425

      Grand Total 16905

      Maybe the problem is here on calculated column:

      =COUNTROWS( SUMMARIZE(export_sensedata_atividades_2024_05_13;export_sensedata_atividades_2024_05_13[SemanaMes]))

       

      Before I forget: Slava Ukraini!!!

      • DimaMD's avatar
        DimaMD
        Solution Sage

        Anonymous Hi, try it DAX, add in sumarize colum "Criada em (Month)"

        =COUNTROWS( 
             SUMMARIZE( 
                  export_sensedata_atividades_2024_05_13;  
          export_sensedata_atividades_2024_05_13[SemanaMes];
        export_sensedata_atividades_2024_05_13[Criada em (Month)]
         )
        )