Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Create DAX table with % calculation

Hello,

 

I need your support with the next issue please.

I have the next 2 tables.

I want to create a 3rd table, calculating for every Audit type, the % of the number of companies in column (company) in table B from the total number of companies identified as 'Important' in table A.

 

Is it possible to create a new column with this calculation automatically once per month ? (target is to avoid to overwrite the existing one, but for example to create new column with the updated % every end of month - to keep history).

 

 

 

Thanks for your support.

Best regards.

  • Hi Anonymous ,

    what about the following solution:

     

     

     Regards FrankAT

6 Replies

  • Anonymous , calculation of no of companies and important in companies creating doubt, can you explain with example

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello,

       

      Thanks for your interest.

      I succeeded to create the table with the team support 😉

      I still don't have an answer for the second part of my question:

       

      Is it possible to save the calculated "%" in a new table (to take a fixed image of these value), every specified frequency (every end of month for example) ? 

       

      BR.

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    Anonymous I believe you want something like:

    Table C = 
    ADDCOLUMNS(
      ADDCOLUMNS(
        SUMMARIZE(
          'Table B',
          [Audit type],
          "Number of companies",COUNTROWS(DISTINCT('Table B'[Company]))
        ),
        "Important company in",COUNTROWS(ALL('Table A'),[Classification]="Important")
      ),
      "%",[Number of companies] / [Important company in]
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello,

       

      Thanks for the solution it is working (after a small correction in line 8 - missing 'FILTER').

       

      BR.

  • FrankAT's avatar
    FrankAT
    Community Champion

    Hi Anonymous ,

    what about the following solution:

     

     

     Regards FrankAT

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks it works perfectly !