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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Lor
New Member

Filtering a table to affect related second table, then calculating a third table

I have three tables in a data set. The first table has all the case information (Table Raw Data [ID, created date, closed date, asignee, name of ticket requestor, etc]. The second table has 2 of the same fields from the first - ID and closed date - but then has a lot of additional columns for office-specific metrics (Table Topic Data [topic category, Primary valueA, Secondary valueA, Tertiary ValueA, Primary valueB, secvalB, etc.]. 

 

The value columns in the second table could have drawn from the same list but not every entry has multiple values, so I used a Dinctinct calculation on a Union of the columns to show a list of all possible unique values from those columns. 

 

ID

PrimevalA

SecvalA

TertvalA

closed date

1

Potato

Ice Cream

Salad

 

2

Salad

Corndog

 

 

3

Cake

Pizza

Corndog

 

 

Table 2 above, after dictinct(union(distinct (TopicData[primevalA]), distinct(topicdata[secvalA]), distinct(topicdata[tertvalA]))) gave me the left column below

 

The right column was Var Count = Newtable[count] 

 

var tbl1 = Union ( Selectcloumns(all(TopicData) "Notional Column", TopicData[primevalA]),

                            ( Selectcloumns(all(TopicData) "Notional Column", TopicData[secvalA]),
                            ( Selectcloumns(all(TopicData) "Notional Column", TopicData[tertvalA]))

var answer = countrows (filter (tabl1, [notional column] = count)) 

Return


Answer

 

Potato

1

Ice Cream

1

Salad

2

Corndog

2

Cake

1

Pizza

1

Fries

1

 

Which works fine. I have a new table with two columns that tells me the unique values from my second table and how many times each option shows up across the entire Topic Data table.

 

However, on my dashboard I have 2 sections, one for new cases and one for closed cases. The new cases section is all data from Raw Data table, and the only thing in the closed case section is a bar chart of the newly calculated table with options and their frequency.

 

I'm trying to use the time slicer that's applied to the Raw Data table (currently set to slice by month) to also filter these option and frequency visuals, and I have no idea how to do that. I got a lot of help just getting this far. I can't unpivot my columns for a variety of reasons.

 

I'm hoping for a way to have PowerBI take the slicer that's applied to the Raw Data visual (currently slicing by month for Date Created) to also run against the Closed Date in the second Topic Data table, then only have the third calculated frequency table look at values within that range. 

 

Any ideas appreciated. 

2 REPLIES 2
Lor
New Member

I don't think unpivoting is the best solution - I have some feature, processing, and storage limits, and the tables aren't only these columns. The Topic Data table has dozens of columns and unpivoting would create thousands of additional rows.

amitchandak
Super User
Super User

@Lor , I think it better to unpivot the columns in PrimevalA, SecvalA, TertvalA in power query and then use

 

Unpivot Data(Power Query): https://youtu.be/2HjkBtxSM0g

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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