Forum Discussion

zia1991's avatar
zia1991
New Member
2 years ago
Solved

divide function

I am new to power bi,Actually i want to divide BL with TBL to get thier ratio,but it give me only one vlaue for the first row,I want the function that resuilt for all row.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Thanks PowerBigginer 

    Hi, zia1991 

    Based on the data provided by your picture, I guess your BL and TBL are both a metric, so I created the following sample data:

    I created two measures and placed them in the table visual:

    I use the following DAX to divide each row:

    MEASURE =
    VAR _seletedvalue =
        CALCULATE ( [TBL1], ALL ( 'Table' ) )
    RETURN
        DIVIDE ( [BL1], _seletedvalue, 0 )

    Here are the results:

    I've provided the PBIX file used this time below.

     

     

     

    How to Get Your Question Answered Quickly

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

    Best Regards

    Jianpeng Li

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

     

     

     

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks PowerBigginer 

    Hi, zia1991 

    Based on the data provided by your picture, I guess your BL and TBL are both a metric, so I created the following sample data:

    I created two measures and placed them in the table visual:

    I use the following DAX to divide each row:

    MEASURE =
    VAR _seletedvalue =
        CALCULATE ( [TBL1], ALL ( 'Table' ) )
    RETURN
        DIVIDE ( [BL1], _seletedvalue, 0 )

    Here are the results:

    I've provided the PBIX file used this time below.

     

     

     

    How to Get Your Question Answered Quickly

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

    Best Regards

    Jianpeng Li

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