Forum Discussion

Didierabiven's avatar
Didierabiven
New Member
8 years ago
Solved

Table generated with a table source from azure

I try to generate with a  SQL table (Table 1)  from azure containing more then one millions of line , a new table (Table 2) generated as describe below.

 

Any Idea what should be the moste efficient way to do it ?

 

Table 1       
ContratStoreKeyDate debutDate FinDate d'achatDate de VenteNombre de Jours
124505003EH1932#12342017-02-102017-02-152017-01-102017-03-165
145012004EH19E2#ADES2017-01-152017-01-152017-05-012018-04-020
145201A003H1932#13AB2017-04-062017-04-282017-01-01 22
        
Table  generated       
        
ContratStoreKeyDate debutDate d'achatDate de Vente  
124505003EH1932#12342017-02-102017-01-102017-03-16  
124505003EH1932#12342017-02-112017-01-102017-03-16  
124505003EH1932#12342017-02-122017-01-102017-03-16  
124505003EH1932#12342017-02-132017-01-102017-03-16  
124505003EH1932#12342017-02-142017-01-102017-03-16  
124505003EH1932#12342017-02-152017-01-102017-03-16  
145012004EH19E2#ADES2017-01-152017-05-012018-04-02  
145201A003H1932#13AB2017-04-062017-04-282017-01-01  
145201A003H1932#13AB2017-04-072017-04-282017-01-01  
145201A003H1932#13AB2017-04-082017-04-282017-01-01  
145201A003H1932#13AB2017-04-092017-04-282017-01-01  
145201A003H1932#13AB2017-04-102017-04-282017-01-01  
145201A003H1932#13AB2017-04-112017-04-282017-01-01  
145201A003H1932#13AB2017-04-122017-04-282017-01-01  
145201A003H1932#13AB2017-04-132017-04-282017-01-01  
145201A003H1932#13AB2017-04-142017-04-282017-01-01  
145201A003H1932#13AB2017-04-152017-04-282017-01-01  
145201A003H1932#13AB2017-04-162017-04-282017-01-01  
145201A003H1932#13AB2017-04-172017-04-282017-01-01  
145201A003H1932#13AB2017-04-182017-04-282017-01-01  
145201A003H1932#13AB2017-04-192017-04-282017-01-01  
145201A003H1932#13AB2017-04-202017-04-282017-01-01  
145201A003H1932#13AB2017-04-212017-04-282017-01-01  
145201A003H1932#13AB2017-04-222017-04-282017-01-01  
145201A003H1932#13AB2017-04-232017-04-282017-01-01  
145201A003H1932#13AB2017-04-242017-04-282017-01-01  
145201A003H1932#13AB2017-04-252017-04-282017-01-01  
145201A003H1932#13AB2017-04-262017-04-282017-01-01  
145201A003H1932#13AB2017-04-272017-04-282017-01-01  
145201A003H1932#13AB2017-04-282017-04-282017-01-01  
  • Didierabiven's avatar
    Didierabiven
    8 years ago

    Thanks a lot for your solution. I have a  question, which one should be the best in term of weight  and speed. ?

2 Replies

  • v-juanli-msft's avatar
    v-juanli-msft
    Community Support

    Hi Didierabiven

    I test with your data using two methods using M in Query Editor and DAX.

    With DAX, Create new tables with following formula.

    Table = CALENDARAUTO()

    Table 2 = CROSSJOIN(table1,FILTER('Table',[Date]<=DATE(2017,4,28)))

    Table 3 = FILTER('Table 2',[flag]=1)

    Here is pbix using DAX.

    In Query Editor, create blank query from New Source->Blank Query, then write M in Advanced Editor.

    Here is my pbix using M.

     

    Best Regards

    Maggie

    • Didierabiven's avatar
      Didierabiven
      New Member

      Thanks a lot for your solution. I have a  question, which one should be the best in term of weight  and speed. ?