Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 months ago
Solved

DAX Formula

 

I have created PBI summarized table and I need another column DAX Formula

column grant total divided by rows total NOT Sum of amount (later will add multiple columns)

 

like 5 /43 , 31/43 , 7/43 how to get this its dynamic

 

 

  • Please try the measure below:

    % of Total =
    DIVIDE(
        SUM('YourTable'[Amount]),
        CALCULATE(
            SUM('YourTable'[Amount]),
            ALLSELECTED('YourTable')
        )
    )

6 Replies

  • Please try the measure below:

    % of Total =
    DIVIDE(
        SUM('YourTable'[Amount]),
        CALCULATE(
            SUM('YourTable'[Amount]),
            ALLSELECTED('YourTable')
        )
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      I need to create two tables to get calculation of value and %, how we can get one table instead of multiple.

      this is example my tables contains huge dataset like region/country/state and etc..

       

      example

      Measure 1 = SUM(Table[amount]

       

      Measure 2 = 

      % of Total =
      DIVIDE(
          SUM('YourTable'[Amount]),
          CALCULATE(
              SUM('YourTable'[Amount]),
              ALLSELECTED('YourTable')
          )
      )

        

  • Hii Anonymous 

     

    You need row value ÷ overall grand total (dynamic). Create a measure, not a column:

    % of Grand Total =
    DIVIDE(
        SUM('Table'[Amount]),
        CALCULATE(
            SUM('Table'[Amount]),
            ALL('Table')
        )
    )

    This keeps the row context (China, International, USCAN) but removes filters to get full grand total (43).

    • Anonymous's avatar
      Anonymous
      Not applicable
      Its return all rows = 1, which is wrong

      Grand Total =

      DIVIDE(    [amount],
      CALCULATE(
          [amount],
        ALL('Region Table'[Region])
      ))
  • Hi,

    First write an explicit measure

    Total = sum(Data[Amount])

    Then use a visual calculation.

  • Hi,

    First write an explicit measure

    Total = sum(Data[Amount])

    Then use a visual calculation.