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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Anonymous
Not applicable

basket analysis

HI, I need help with the following dax.

 

I have a table (store name, date, customer ID, bought item , price etc...)

To do a basket analysis, I created a second table with following DAX:

 

Filter ( Crossjoin ( Values ( 'POS' [Item]), Selectcolumns ( Values ( 'POS' [Item]), "Item2", [Item] )), [Item] > [Item] )

 

This works fine, but I would like to add, [store name] and [ year-month] .

 

How can I modify the above Dax that it will contain these two columns?

 

Thanks for your help

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous ,

You can have like this

Filter ( Crossjoin ( Values ( 'POS' [Item]), Selectcolumns ( 'POS', "Item2", [Item], "store name" , [store name]," year-month",[ year-month] )), [Item] > [Item] )

 

 

Cross join do not take same column name, select columns is used to restrict /rename columns

 

You can take full tables too.

crossjoin(table1,Table2)

both can have selectcolumns

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandakunderstood. Thanks for your explanation. This worked perfectly

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

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

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

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

Top Solution Authors