Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
First of all, thanks for helping me!
My help needed is as below:
For example: i have 3 countries to take care of : (Thailand, America, China) as shown below. I am recording the no. of accidents and the headcount for each month.
From my raw data below, it didnt have a "Date" as highlighted originally. I would like to create a new column in PowerBI and to add the monthly date e.g. Jan-23 for the first 3 rows, Feb-23 for the subsequently 3 rows after the first three. etc etc until December 2023. May i know how should i do this during the power query in PowerBI to add new column?
Thanks!
Solved! Go to Solution.
@YmmotEul , In power Query first add an index column starting with 0
Index Column: https://youtu.be/NS4esnCDqVw
Then add a new column in power query
Date.AddDays(#date(2023,01,01) , Number.IntegerDivide([Index],3))
Hi,
Is there no column in your dataset from where a date can be created i.e. columns such as Month number/Month name/Year? Anyways, share the dataset in a format that can be pasted in an MS Excel file.
Hi
From Amit;'s solution, i changed from
Date.AddDays(#date(2023,01,01) , Number.IntegerDivide([Index],3)) ->>>>> Date.AddMONTHS and it worked.
Dear Amit, The dates it returned was all January 2023 i.e. The first 3 rows are 1-jan, the next 3 rows are 2-Jan, where the next 3 rows should have been 1-Feb.
Thanks could you take a look again on this?
@YmmotEul , In power Query first add an index column starting with 0
Index Column: https://youtu.be/NS4esnCDqVw
Then add a new column in power query
Date.AddDays(#date(2023,01,01) , Number.IntegerDivide([Index],3))
User | Count |
---|---|
98 | |
90 | |
77 | |
71 | |
64 |
User | Count |
---|---|
114 | |
97 | |
95 | |
68 | |
65 |