Forum Discussion
New Measure Dependent on Month
- 3 years ago
Hi Dbuck44 ,
Even if you do not have it now I highly recommend you to start using date tables since it will help you now as well as in future models since it is a highly recommended and best practice. So please adjust your current model. Here is how you can do it:
1) go to your table in Power Query and create a custom column called "Date" with the following formula: #date([column of year],[column of month],1). By that the first of the month represents your month in a year.
2) Now please create a date table with at least the following sequence 01.01.20xx, 01.02.20xx ... 01.12.20xx - You can also use a complete date table - it doesnt matter in this case.
3) connect your new date table to your transaction table to have a proper star schema
4) use my measure above 🙂
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
-----------------------------------------------------
Where does that time intelligence code go? I'm using the Transform Data power query editor and "create custome column" to create the measure
Hi Dbuck44 ,
Even if you do not have it now I highly recommend you to start using date tables since it will help you now as well as in future models since it is a highly recommended and best practice. So please adjust your current model. Here is how you can do it:
1) go to your table in Power Query and create a custom column called "Date" with the following formula: #date([column of year],[column of month],1). By that the first of the month represents your month in a year.
2) Now please create a date table with at least the following sequence 01.01.20xx, 01.02.20xx ... 01.12.20xx - You can also use a complete date table - it doesnt matter in this case.
3) connect your new date table to your transaction table to have a proper star schema
4) use my measure above 🙂
Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your thumbs up!
@ me in replies or I'll lose your thread.
-----------------------------------------------------