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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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