Forum Discussion
DAX Calculation Help with filters on visual
- Anonymous5 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)+0total 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.
so I wouldn't want the total items to change with the item filter, just with the date filter.
so for example with 4/15 and 4/16 sleceted and Accessory a selected I would see
Accessory A
how many times = 2
total item = 8
Not the best at this, but you could try:
total orders = SUMX ( ALLEXCEPT(ordertable, ordertable[call_time]), DISTINCTCOUNT( ordertable[call_id] ) )