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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Grant_Reid
Frequent Visitor

Using output of INTERSECT

Hi

From my request for help below, clearly I'm someone new to DAX. I have a measure in which I use INTERSECT to return a list of CustomerKeys of Customers who have been Invoiced in the last 30 days - see below.

 

30 Returning Name =
VAR InterestPeriod =
SUMMARIZE (
FILTER ( Transactions, Transactions[DaysSinceInvoice] <= 30 ),
Transactions[CustomerKey]
)
VAR Balance =
SUMMARIZE (
FILTER ( Transactions, Transactions[DaysSinceInvoice] > 30 ),
Transactions[CustomerKey]
)
VAR CustomerKeys =
INTERSECT ( Balance, InterestPeriod )
RETURN
CustomerKeys

I need to know how I can use this in a Table / Matrix to return the relevant Customer name from the "Customers" table. There is a 1 to many relationship defined between the "Customers" and "Transactions" table on CustomerKeys column.

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Grant_Reid ,

INTERSECT() function would return a whole table so it could not be used in a measure directly.

You can create a measure like this, put it in the visual filter and set its value as 1:

visual control = 
VAR InterestPeriod =
    SUMMARIZE (
        FILTER ( Transactions, Transactions[DaysSinceInvoice] <= 30 ),
        Transactions[CustomerKey]
    )
VAR Balance =
    SUMMARIZE (
        FILTER ( Transactions, Transactions[DaysSinceInvoice] > 30 ),
        Transactions[CustomerKey]
    )
VAR CustomerKeys =
    INTERSECT ( Balance, InterestPeriod )
RETURN
    IF (
        MAXX (
            FILTER ( CustomerKeys, [CustomerKey] IN DISTINCT ( 'Customers'[CustomerKey] ) ),
            [CustomerKey]
        )
            = SELECTEDVALUE ( Customers[CustomerKey] ),
        1,
        0
    )

re.png

 

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

View solution in original post

1 REPLY 1
v-yingjl
Community Support
Community Support

Hi @Grant_Reid ,

INTERSECT() function would return a whole table so it could not be used in a measure directly.

You can create a measure like this, put it in the visual filter and set its value as 1:

visual control = 
VAR InterestPeriod =
    SUMMARIZE (
        FILTER ( Transactions, Transactions[DaysSinceInvoice] <= 30 ),
        Transactions[CustomerKey]
    )
VAR Balance =
    SUMMARIZE (
        FILTER ( Transactions, Transactions[DaysSinceInvoice] > 30 ),
        Transactions[CustomerKey]
    )
VAR CustomerKeys =
    INTERSECT ( Balance, InterestPeriod )
RETURN
    IF (
        MAXX (
            FILTER ( CustomerKeys, [CustomerKey] IN DISTINCT ( 'Customers'[CustomerKey] ) ),
            [CustomerKey]
        )
            = SELECTEDVALUE ( Customers[CustomerKey] ),
        1,
        0
    )

re.png

 

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.