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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Pass values between two tables for a slicer field

Hi All,

    I have a scenarion where I have below two tables.

    In Table 1, Date field will be used as a slicer and for the selected Date i,e Q1, I need to know how can I pass Table1[MonthNum] values to Table2[MonthNumber] and show a measure that shows Sales for selected Quarter.

    If I create relationship, then I end up with Many to Many and I dont want to go with Bridge Table.

 

 

Table1:

DateMonthNum
Q1M01
Q1M02
Q1M03
Q2M04

 

Table2:

MonthNumberSales
M0110
M0215
M015
M0220
  
1 ACCEPTED SOLUTION
jgeddes
Super User
Super User

Depending on how you are intending to use the measure this will work

SalesSum =
CALCULATE(
    SUM(Table2[Sales]),
    TREATAS(VALUES(Table1[MonthNum]),Table2[MonthNumber])
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
PaulDBrown
Community Champion
Community Champion

Ideally you should create separate dimension tables for month and quarter to use as slicers. Add a new column to Table 2 to get the Quarter value using a SWITCH Function. 
You can then create one-to-many relationships between corresponding fields.





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






jgeddes
Super User
Super User

Depending on how you are intending to use the measure this will work

SalesSum =
CALCULATE(
    SUM(Table2[Sales]),
    TREATAS(VALUES(Table1[MonthNum]),Table2[MonthNumber])
)




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.