Forum Discussion

harirao's avatar
harirao
Icon for Post Prodigy rankPost Prodigy
5 years ago
Solved

Need to use Average & Divide function

Hello All,

 

Required your assistance, i want use create a dax where, Average & Divide function need to be used for example:
Avg of MAX_Cal_MWT / SapsoliShipID


Measure : 

DIVIDE(AVERAGE(tbl_dep3_big_deal_perf_data_final_main[MAX_Cal_MWT]),tbl_dep3_big_deal_perf_data_final_main[sapsoliID],0)

Thanks for your help in advance.

  • @harirao, what's the problem. Not very clear.

    If the denominator is not a measure. Then you need the aggregation there to

    Depending on the need it can be count, distinctcount, sum Average Atc

    DIVIDE(AVERAGE(tbl_dep3_big_deal_perf_data_final_main[MAX_Cal_MWT]),Count(tbl_dep3_big_deal_perf_data_final_main[sapsoliID]),0)

  • @harirao , you can change the data type to decimal by adding some decimal places and checking.

    Can you share sample data and sample output in table format? Or a sample of pbix after deleting sensitive data.

    Data Format New Rib.png

3 Replies

  • @harirao, what's the problem. Not very clear.

    If the denominator is not a measure. Then you need the aggregation there to

    Depending on the need it can be count, distinctcount, sum Average Atc

    DIVIDE(AVERAGE(tbl_dep3_big_deal_perf_data_final_main[MAX_Cal_MWT]),Count(tbl_dep3_big_deal_perf_data_final_main[sapsoliID]),0)

    • harirao's avatar
      harirao
      Icon for Post Prodigy rankPost Prodigy

      Hello amitchandak ,

       

      Thanks for your quick response, I want to create a single dax using two columns from source Average & divide function i.e (Avg of MAX_Cal_MWT by SapsoliShipID)

      Getting all values as Zero:

      Test_1 = DIVIDE(AVERAGE(tbl_dep3_big_deal_perf_data_final_main[MAX_Cal_MWT]),Count(tbl_dep3_big_deal_perf_data_final_main[SapsoliShipID]),0)



       

      Thank you

      • amitchandak's avatar
        amitchandak
        Icon for Super User rankSuper User

        @harirao , you can change the data type to decimal by adding some decimal places and checking.

        Can you share sample data and sample output in table format? Or a sample of pbix after deleting sensitive data.

        Data Format New Rib.png