Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

DAX Calculation Help with filters on visual

I have the following data, by day. this is an example of Multiple days data.    Moment call_id call_time Widget b 4509105517166590 4/15/2021 Widget a 4505281519878140 4/15/2021 Wi...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous,

     

    Accoriding to my understanding, you want to get dynamic count and percentage based on selected values in slicer(Moment and Date), right?

     

    I have done it with creating a new table using the following formula:

    NewTable = DISTINCT(SELECTCOLUMNS('Table',"Product",[Moment]))

     

    Then please try these:

    how many times = IF(MAX('NewTable'[Product]) in ALLSELECTED('Table'[Moment]),CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Moment]=MAX('NewTable'[Product]))),0)+0
    total items = CALCULATE(COUNTROWS('Table'),FILTER('NewTable','NewTable'[Product] =MAX('Table'[Moment])))
    % on order = DIVIDE([how many times],[total items])

    The final output is shown below:

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