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
Anonymous
Not applicable

new line for each sales manager

Hello Community 🙂

 

Need help about a subject.

 

Table Calendar create with calendar(datea,datec)

date a
date b
date c

 

Table Sales : table comes from webservice (API)

 

John
Marc
Jane

 

I have a calendar from date A to Date B

I want to create for each day a line for each sales manger in order ti calculate turnover / .... by sales manger afterwards.

 

Results wanted : 

date a
John
Marc
Jane
date b
John
Marc
Jane
date c
John
Marc
Jane

 

thanks for your help. regards 🙂

 

NB : Don't hesitate proposing something for efficient if you know 🙂

1 ACCEPTED SOLUTION

Hello @Anonymous ,

 

Is not Union what has been suggested by @amitchandak but CrossJoin.

 

See below:

 

Payeras_BI_0-1604481435900.png

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

I don't know why but after my last PowerBI update, my problem is solved, no more #ERROR.

The solution is the CROOSJOIN function.

Thanks to all of you !!!! 🙂

@v-yiruan-msft @Payeras_BI @amitchandak

Anonymous
Not applicable

hello, @amitchandak thanks for your answer 🙂

I don't think UNION answer my question because when I use UNION, the resutt is

date a

date b

date c

John

Marc

Jane

i need to create a line for each sales manager given by the table SalesManager (get by API) for each days created by calendar(datea,datec)

date a | John

date a | Marc

date a | Jane

date b | John

date b | Marc

date b | Jane

date c John

date c Marc

date c | Jane

thanks 🙂

have a good day

Hello @Anonymous ,

 

Is not Union what has been suggested by @amitchandak but CrossJoin.

 

See below:

 

Payeras_BI_0-1604481435900.png

 

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain
Anonymous
Not applicable

Sorry 

you are right.

 

do you know why I have this #ERROR

Capture d’écran 2020-11-04 103016.png

Hi @Anonymous ,

I believe you do not want to create a new column but a new table.

Instead of New column click on New table and use the same DAX code, the resulting table will be what you are looking for.

 

Payeras_BI_0-1604485145969.png

Regards,

 

J. Payeras

If this post answered your question, please mark it as a solution to help other users find useful content.
Kudos are another nice way to acknowledge those who tried to help you.

J. Payeras
Mallorca, Spain
Anonymous
Not applicable

thanks it's exactly what I want 🙂

but I still have a mistake 😞

Capture d’écran 2020-11-04 113227.png

Hi @Anonymous ,

Does the sales table contain fields other than [sales] field? Does it also include the field named "Date"? If it also contains a field named Date, please rename the corresponding field and then cross join the table. Or you can try the method in the following thread:

Power Query Cross Join

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Anonymous , Do you want a cross join

 

crossjoin(Date, Sales) or use selectcolumns to select the columns you want

https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/

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.