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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
marcel97
Helper II
Helper II

Issues with FILTER and ALLSELECTED when using filters from dimension table

Hello all,

 

I have a very basic calculation that I want to do; I have a table that contains for every week, how many open work items there are and how they are split between teams, types and other criteria. Please find the sample data attached:

 

Date_IDTeam_IDTypeProject Total Count
2023_12_041Type 1Project 19
2023_12_041Type 2Project 18
2023_12_042Type 1Project 16
2023_12_042Type 2Project 17
2023_12_043Type 1Project 114
2023_12_043Type 2Project 115
2023_12_011Type 1Project 17
2023_12_011Type 2Project 16
2023_12_012Type 1Project 14
2023_12_012Type 2Project 15
2023_12_013Type 1Project 112
2023_12_013Type 2Project 113
2023_11_241Type 1Project 15
2023_11_241Type 2Project 14
2023_11_242Type 1Project 12
2023_11_242Type 2Project 13
2023_11_243Type 1Project 110
2023_11_243Type 2Project 111

 

Through a measure I want to find out, how many items there have been at the previous date. Getting the Date_ID of the previous date works easily via the following variable within my measure:

 

var Previousdate = MAXX(FILTER(ALLSELECTED(Items), Items[Date_ID]<SELECTEDVALUE(Items[Date_ID])), Items[Date_ID])
 
marcel97_0-1701686667952.png

 

Returning the Count of Items for the previous week is tricky; I tried the following measure:

 

Total_Count_Previousdate = SUMX(Filter(Items, Items[Date_ID]=Previousdate),Items[Total Count])
 
which does not yield any results, therefore I tried:
 
Total_Count_Previousdate = SUMX(FIlter(ALLSELECTED(Items),Items[Date_ID]=Previousdate),Items[Total Count])
 
which delivers the numbers that I want to see:
 
marcel97_1-1701687707575.png

 

However; I also want those numbers to react to filters, which is only possible when I use filter attributes from this table (e.g. TEAM_ID), not attributes from a related dimension table like this one:
 
TEAM_IDTEAM_NAME
1Team 1
2Team 2
3Team 3
 
 How can I adjust the measure so that the numbers will be influenced by filters that I set on another dimension table?
 
Any help is appreciated!
 
Thanks!!!
 
 
 

 

 
 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @marcel97 ,

Thanks for reaching out to us with your question. Base on my description, it seems that you want to filter the data correctly base on another dimension table. Did you create any relationship with team dimension table and Items table? If yes, it should filter the data correctly. Please find the details in the attachment.

vyiruanmsft_0-1701838152512.png

vyiruanmsft_1-1701838181837.png

If the above one can't help you get the expected result, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with specific examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

View solution in original post

2 REPLIES 2
CoreyP
Solution Sage
Solution Sage

I would also recommend changing the data type of your date ID column to date, and creating a date dimension table. Power BI has really awesome time intelligence DAX functions that only work if you have a date table in your star schema. 

Anonymous
Not applicable

Hi @marcel97 ,

Thanks for reaching out to us with your question. Base on my description, it seems that you want to filter the data correctly base on another dimension table. Did you create any relationship with team dimension table and Items table? If yes, it should filter the data correctly. Please find the details in the attachment.

vyiruanmsft_0-1701838152512.png

vyiruanmsft_1-1701838181837.png

If the above one can't help you get the expected result, please provide some raw data in your tables (exclude sensitive data) with Text format and your expected result with specific examples. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors