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

Create subtable and use it as filter to the initial table in order to count another field values

Hello guys.

I am trying to find a way to execute the above calculation with DAX.

I have Table1 with 4 columns (Username, TN, ID_number, Date)

1) The first step I want to do is to filter table1 by username (whatever starts with "A" for example) and create a new sub-table (table1A). (I have done that in Power Query)

2) Then I want to make a list of unique TNs from table1A (something like a key),

3) Filter the initial table1 only with these TNs, keep only the rows that the table1(Date) > table1A(date) and then count the ID_numbers

 

I forgot to mention that after the first step that i did in poiwer query I went to power bi and create a relationship between table1 TNs and tableA1 TNs in a way to try to make my model check the usernames from table1A use the TN value from that table row and check all same TNs from initial table1 and then count the ID-numbers for these rows. I am not quiet sure that this thing (relationship table1[TN] - table1A[TN] works. Also,  the problem remains because I want to count only the ID_numbers that come from rows (that matche TNs) and are after the table1A Date value for every TN

 

Any help 

1 REPLY 1
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous 

It seems you may try to use GENERATE function like this post.If it is not your case,could you  follow the How to Get Your Question Answered Quickly to post your simple assumed data and expected output.It would be better if you can upload the .pbix file to OneDrive and post the link here.

Regards,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.