Forum Discussion

Matth_P's avatar
Matth_P
New Member
2 years ago
Solved

Help with Filtering a Table by Promotion Parameters in Power BI

Hi everyone, I'm working on a Power BI report where I have two tables: Base and Promotions. The Base table includes sales, profitability, and cost data for all products by day and by branch, whi...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi  Matth_P ,

    I created some data:

    Base:

    Promotions:

    Here are the steps you can follow:

    1. Create measure.

    Flag =
    var _select=SELECTEDVALUE('Promotions'[ProCod])
    var _date=SELECTCOLUMNS(FILTER(ALL('Promotions'),'Promotions'[ProCod]=_select),"date",'Promotions'[Date])
    RETURN
    IF(
        MAX('Base'[Date]) in _date,1,0)

    2. Place [Flag]in Filters, set is=1, apply filter.

    3. 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