Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Visualize only the value match with requirement

Dear all, May I ask your advice for below issue?   Data: product, week, value Expectation: flexibility to select 2 weeks by a slicer The chart will only shows product that have value of the la...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Anonymous ,

     

    Please follow these steps:

    1. Add a nw table for slicer:

    2. Add measures :

    <28 = 
    var _min=MIN('Table 2'[Week])
    var _minvalue=CALCULATE(MAX('Table'[Value]),FILTER('Table',[Product]=MAX('Table'[Product])&&[Week]=_min))
    return IF(_minvalue<28,_minvalue)
    >28 = 
    var _max=MAX('Table 2'[Week])
    var _maxvalue=CALCULATE(MAX('Table'[Value]),FILTER('Table',[Product]=MAX('Table'[Product])&&[Week]=_max))
    return IF(_maxvalue>28,_maxvalue)
    flag = IF(ISBLANK([<28]),[>28],[<28])
    output = IF(CALCULATE(COUNTROWS('Table'),FILTER(ALLEXCEPT('Table','Table'[Product]),[flag]<>BLANK()))=2,[flag])

    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.