Forum Discussion

misul's avatar
misul
Helper I
8 years ago
Solved

Dynamic Segmentation - with duplicate rows

Hi,  I am trying to follow this blog post about Dynamic Segmentation. https://www.daxpatterns.com/dynamic-segmentation/   I am stuck on one point - what to do when there are duplicate transactions...
  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    8 years ago

    misul

     

    I have used this MEASURE in the LookUp Table

     

    Measure =
    VAR mysales =
        CALCULATE ( SUM ( Table1[Sales] ) )
    RETURN
        CALCULATE (
            SUM ( Table1[Sales] ),
            FILTER (
                VALUES ( Table1[Product] ),
                mysales >= SELECTEDVALUE ( CategoryLookup[Lower] )
                    && mysales < SELECTEDVALUE ( categoryLookup[Upper] )
            )
        )