Forum Discussion

nesrinehal20's avatar
nesrinehal20
Frequent Visitor
1 year ago
Solved

Dax measure formula

I have a file that contains columns (item, item_description, opening time, position, center). I want to calculate key to_bs which is equal to opening time of each article on total opening time for po...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Thanks for the reply from HarshSathwara19 , Kedar_Pande  and rajendraongole1 , please allow me to provide another insight: 
    Hi  nesrinehal20 ,

    You can use the allselected() function to dynamically get the values after filtering.

    ALLSELECTED function (DAX) - DAX | Microsoft Learn

    The ALLSELECTED function gets the context that represents all rows and columns in the query, while keeping explicit filters and contexts other than row and column filters. This function can be used to obtain visual totals in queries.

     

    Here are the steps you can follow:

    1. Create measure.

    Measure =
    var _allsum=
    SUMX(ALLSELECTED('Table'),[open time item])
    return
    DIVIDE(
        SUM('Table'[open time item]),_allsum)

    2. Result:

     

     

    Best Regards,

    Liu Yang

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