How to divide each row of a calculated column by the total of another calculated column?

后端 未结 3 1764
心在旅途
心在旅途 2021-01-16 02:37

I can\'t get a division correct with this sample data:

Calculated column    Another calc. column
   48                  207
  257                  370
  518          


        
3条回答
  •  情书的邮戳
    2021-01-16 03:01

    For me the following works:

    DIVIDE( Table1[Calculated column], SUM(Table1[Another calc column]) )
    

    If that's not working, I'd need to see a file where you can reproduce the problem.


    Edit: After looking at your file, the total of 82,826 is only true with the filters you've selected.

    Note that calculated columns are not dynamic and cannot be responsive to filters since they are calculated only when the table is first loaded.

    If you need it to be dynamic, then write it as a measure more like this:

    Earned Daily =
    DIVIDE (
        CALCULATE (
            SUM ( 'Test data'[Value] ),
            'Test data'[Act Rem] = "Actual Units",
            'Test data'[Type] = "Current"
        ),
        CALCULATE (
            SUM ( 'Test data'[Value] ),
            ALLSELECTED ( 'Test data' ),
            'Test data'[Act Rem] = "Remaining Units",
            'Test data'[Type] = "PMB"
        )
    )
    

提交回复
热议问题