Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
2 years ago
Solved

Help with calculations in Power BI

I need to divide the following columns: I need to divide the blue by the red for all entries. So I will need to do the following

1423.59/4602.72

1423.59/4602.72

989.71/4602.72

2189.42/4602.72

 

 

 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Syndicate_Admin 

    You can try the following code.

    Measure =
    VAR a =
        CALCULATE (
            SUM ( 'Table'[lons] ),
            FILTER ( ALLSELECTED ( 'Table' ), [Month] IN VALUES ( 'Table'[Month] ) )
        )
    RETURN
        DIVIDE ( SUM ( 'Table'[lons] ), a )
    

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Syndicate_Admin 

    You can try the following code.

    Measure =
    VAR a =
        CALCULATE (
            SUM ( 'Table'[lons] ),
            FILTER ( ALLSELECTED ( 'Table' ), [Month] IN VALUES ( 'Table'[Month] ) )
        )
    RETURN
        DIVIDE ( SUM ( 'Table'[lons] ), a )
    

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Syndicate_Admin 

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

         

        Best Regards!

        Yolo Zhu