Forum Discussion

capko's avatar
capko
Icon for Helper II rankHelper II
2 years ago
Solved

Create a line by article each month

Hello,

 

I have a table like the following one in Power BI (and not in Power Query, it's a calculated table using DISTINCT from another table):

 

Article
A
B
C
D

 

I would like to have the following result:

 

ArticleDate
A01/2021
A02/2021
A03/2021
A04/2021
......

 

And to have all the dates month by month since 01/01/2021 until 31/12/2023 for each one of the articles.

 

Does anyone know how to do that without a blank query in Power Query ?

 

  • there is still such an option

     

    Table 2 = DISTINCT(SELECTCOLUMNS(
          GENERATE( DISTINCT('Article'[Article]),
                  GENERATESERIES(DATE(2021,1,1),DATE(2023,12,31),1)
                  ) ,"Article",[Article],"Momth", EOMONTH([Value],-1)+1))

     

4 Replies

  • pls try this

    Table 2 = 
          GENERATE( DISTINCT('Article'[Article]),
                  GENERATESERIES(DATE(2021,1,1),DATE(2023,12,31),1)
                  )

    • capko's avatar
      capko
      Icon for Helper II rankHelper II

      Thanks ! But this is day by day. Is there another way to make it month by month ?

      • Ahmedx's avatar
        Ahmedx
        Icon for Super User rankSuper User

        yes! pls try this

         

         

         

        Table 2 = DISTINCT(SELECTCOLUMNS(
              GENERATE( DISTINCT('Article'[Article]),
                      GENERATESERIES(DATE(2021,1,1),DATE(2023,12,31),1)
                      ) ,"Article",[Article],"Momth", EOMONTH([Value],-1)+1))
        ------------------

         

         

         

  • there is still such an option

     

    Table 2 = DISTINCT(SELECTCOLUMNS(
          GENERATE( DISTINCT('Article'[Article]),
                  GENERATESERIES(DATE(2021,1,1),DATE(2023,12,31),1)
                  ) ,"Article",[Article],"Momth", EOMONTH([Value],-1)+1))