Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Matth_P
New Member

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, while the Promotions table includes similar data but only for products that are part of specific promotions. The tables are linked by the column LOCCOD-SKU-DATE, which is a concatenation of the columns LOCCOD (Branch code), SKU (Product code), and DATE.

I want to create a slicer to select a promotion (ProCod) from the Promotions table and have this filter the Base table to show only the relevant products and branches included in the selected promotion. I want to leave the date without filtering so users can compare those same products and branches in a time period where there was no promotion.

Thanks in advance for your help!

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Matth_P ,

I created some data:

Base:

vyangliumsft_0-1716271819385.png

Promotions:

vyangliumsft_1-1716271819386.png

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.

vyangliumsft_2-1716271836756.png

3. Result:

vyangliumsft_3-1716271836757.png

 

 

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

View solution in original post

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @Matth_P ,

I created some data:

Base:

vyangliumsft_0-1716271819385.png

Promotions:

vyangliumsft_1-1716271819386.png

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.

vyangliumsft_2-1716271836756.png

3. Result:

vyangliumsft_3-1716271836757.png

 

 

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.