Forum Discussion
capko
Helper II
2 years agoCreate 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:
| Article | Date |
| A | 01/2021 |
| A | 02/2021 |
| A | 03/2021 |
| A | 04/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
- Ahmedx
Super User
pls try this
Table 2 = GENERATE( DISTINCT('Article'[Article]), GENERATESERIES(DATE(2021,1,1),DATE(2023,12,31),1) )- capko
Helper II
Thanks ! But this is day by day. Is there another way to make it month by month ?
- Ahmedx
Super 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)) ------------------
- Ahmedx
Super User
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))