cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IX
Super User IX

Re: basket analysis

@nabe ,

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
Highlighted
Super User IX
Super User IX

Re: basket analysis

@nabe ,

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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Helper II
Helper II

Re: basket analysis

@amitchandakunderstood. Thanks for your explanation. This worked perfectly

Helpful resources

Announcements
Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Upcoming Events

Community Summit North America – Join Online!

Join this community-driven Power Platform digital event for unbiased support and problem-solving.

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Top Solution Authors