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!!
My Recent Blog -Week is not so Weak 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!!
My Recent Blog -Week is not so Weak 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
Meet the 2020 Season 2 Power BI Super Users!

Meet the 2020 Season 2 Power BI Super Users!

Find out who's part of the program this season, and welcome the new Super Users.

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.

Top Solution Authors
Top Kudoed Authors