Forum Discussion
Calculated columns for specific dates and also for multiple conditions
I need to calculate some values as on each fortnightly period (15th of the month and end of the month). One of the dimension tables has rows with start and end dates and I am trying to add a calculated column with period end dates. I found the formula "= {Number.From([Start Date])..Number.From([End Date])}" which creates additional rows for each date between the start and end date. How do I modify this formula to consider only 15th and end of the month? I have tried filtering the dates but it's a lot of manual work (as this model needs to be updated every week).
I also need to create another calculated column showing the status with multiple conditions depending on the above period end dates and some other columns (for example, if "ABC" column is not blank, and today is more than start date and less than end date, then change the status to "staffed"). I tried IF and SWITCH but it gives an error. How do I add multiple conditions?
Lastly, how do I optimize this model such that it can be updated every week by multiple people through a two-way linked Excel sheet (i.e. they can make changes or add rows in a single Excel sheet which shows existing historical data from Power BI as well)
1 Reply
- lbendlinSuper User
I need to calculate some values as on each fortnightly period (15th of the month and end of the month).Abandon this approach and use an external reference table instead . You could even use a flag column in your standard calendar table.
Trying to do this in Power Query will make you unhappy.