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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

Creating a subset of table to isolate ID then using those ID values to filter the original fact tabl

Hello community (clarification),

 

I need help with identifying all unit_ids in my fact table (picture 3) that meet my slicer selection criteria. Then I want to clear all selections on that fact table and filter that fact table on those unit_ids that I selected in my previous step. I can accomplish this with two fact tables but because the fact table is huge (and will grow fast) I would prefer to solve this with DAX measures and not with redundant data if it is possible (picture 1). I don't mind duplicating the any table but the units table.

 

My question is, is it possible? If yes, how do I do it? Data and screenshot are provided below.

 

Picture 1 - The mechanism 

report.jpg

Description: The three slicers at the top of Step 1 filter the table below them. That is what normally happens. That is not the reslut I want, I want the result in Step 2 where measures somehow magically identify the UnitIds and filters a table based on that.

 

Picture 2 - Data model

data_model.jpg

 

 

Picture 3 - units table, the fact table

units.jpg

units table data

UnitsIdDatesCategoryIdSubCategoryId
12021010111
22021010112
32021010112
12021010123
22021010123
32021010124
12021010135
32021010136
22021010136
32021010147
12021010147
22021010147
12021010158
32021010159
22021010159

 

 

Picture 4 - dates table

dates.jpg

dates table data

DateIdDateYearMonthDay
202101012021-01-01202111
202101022021-01-02202112
202101032021-01-03202113
202101042021-01-04202114
202101052021-01-05202115
202101062021-01-06202116
202101072021-01-07202117
202101082021-01-08202118
202101092021-01-09202119
202101102021-01-102021110

 

 

Picture 5 - categories table

categories.jpg

category table data

CategoryIdCategory
1A
2B
3C
4D
5E

 

 

Picture 6 - subcategories table

subcategories.jpg

subcategory table data

SubCategoryIdCategoryId
1aa
2ab
3ba
4bb
5ca
6cd
7da
8ea
9ee

 

 

 

 

OLD MESSAGE BELOW

 

I have a challenge I have not been able to solve with DAX. I have 5 tables in my data model: four dimension tables and one fact table. The fact table has five columns, one id column and four columns which correspond to the four dimension tables.


In the first step I would like to select a subset of the rows from the fact table. I do this with the help slicers based of the dimension tables. So far so good. From now on, it gets difficult. With the current selections made I would like to “keep” the id values of that subset (selection).


Now with those id values isolated I want to reset all filters on the fact table and use those ids to create the actual data subset of interest, i.e. I want to use those ids to filter the original and unfiltered fact table. I then want to use distinctcount to count the occurrences of those ids across the dimensions.

 

READ UPDATE BELOW

 

A mocup of my fact table:

 

idcat_acat_bcat_cdate
1aaaaaa20210101
1aababa20210101
1aababb20210101
1bbabaa20210101
1bbbbba20210101
2aaaaaa20210101

 

NOTE: I have been able to solve this with duplicating my fact table, but since this table is a couple of millions of rows and is growing fast I would like to avoid the duplication of the fact table and solve it with DAX and maybe duplicates of the dimensions if necessary.

 

Thank you for reading.

 

UPDATE

This problem has me so confused I included the wrong mockup. I'm sorry! This is how the fact table looks:

 

IdDateCatSubCat
120210101cat_aaa
220210101cat_aab
320210101cat_aab
120210101cat_bba
220210101cat_bba
320210101cat_bbb
120210101cat_cca
320210101cat_ccd
220210101cat_ccd
320210101cat_dda
120210101cat_dda
220210101cat_dda
120210101cat_eea
320210101cat_eee
220210101cat_eee
4 REPLIES 4
Anonymous
Not applicable

2nd attempt to get help with this challenge. Does anyone have any idea how to go about it?

Anonymous
Not applicable

Bump (only once) b/c rewritten message with screenshots and data.

amitchandak
Super User
Super User

@Anonymous , You try something like this , but usually remove filter from context does not remove filtered value

 

measure =

var _1 = summarize(allselected(Table), Table[ID])

return

calculate([Meausre], filter(all(Table), Table[ID] in _1) )

 

But this may not show dimesion values which are not selected in slicer

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hello @amitchandak ,

 

Thank you for the quick reply. Unfortunately the suggested measure does not work as expected. The measure repeats the total value on every row in the table visual. The table visual only contains cat_a, cat_b, cat_c and the measure.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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