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
MISgirlNY
Frequent Visitor

Need help with a measure

Hello, Power BI community, need some help. I have two tables :

Table1 and Table2 both with fields ID (Unique in each table) and Date (date format).  

Need to count how many IDs from Table2 are in Table1 with Table1.Date < '1/1/2019'

Any help is greatly appreciated!!

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @MISgirlNY 

Try this measure in a card visual:

Measure =
COUNTROWS (
    INTERSECT (
        CALCULATETABLE ( DISTINCT ( Table1[ID] ), Table1[Date] < DATE ( 2019, 1, 1 ) ),
        DISTINCT ( Table2[ID] )
    )
)

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

View solution in original post

3 REPLIES 3
Nathaniel_C
Super User
Super User

Hi @MISgirlNY ,

 

 

Let me know if you have any questions.

 

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

 

 

Date less than and in table 2 = Calculate(Count(T1[ID]) , FILTER(T1,T1[ID]=LOOKUPVALUE(T2[ID],T2[ID],T1[ID] ) && T1[Date]<Date(2019,1,3)  ))

 

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




AlB
Super User
Super User

Hi @MISgirlNY 

Try this measure in a card visual:

Measure =
COUNTROWS (
    INTERSECT (
        CALCULATETABLE ( DISTINCT ( Table1[ID] ), Table1[Date] < DATE ( 2019, 1, 1 ) ),
        DISTINCT ( Table2[ID] )
    )
)

 

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

MISgirlNY
Frequent Visitor

Thank you! Good idea! I've done it differently, linked two tables by ID. But I like INTERSECT better!  

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.