Forum Discussion
Filter by Calendar Weeks
Hi, I am new to Power Bi and I am trying to come up with a way to filter my projects by calendar week. The scenario is for tracking the capacity of different Ovens in which pieces are stressed over a period of time.
Currently when an Oven has 'Start Calendar Week' = 1 and 'End calendar Week' = 3 the Oven will not be shown when I select the 'Calendar Week' = 2 which is what i am trying to achieve. How can I accomplish this, by measures or calculated columns? I think the solution would be to get the value of the calendar week slicer and then calculate something like this:
Simplified Code
IF ('Start Calendar Week' <= 'Selected Calendar Week' <= 'End Calendar Week')
THEN Show this Oven
Remaining Capacity Problem
'Capacity' - 'Pieces' of first Product = 'Remaining Capacity'
IF Number of the same 'Oven ID' during 'Selected Calendar Week' > 1
FOR Count = 1; Count < Number of same 'Oven ID'; ++Count
'Remaining Capacity' =- 'Pieces' of Count
My four tables and the relevant columns are
A Calendar table in which I already created a calculated column for the 'Calendar Week'. It has a relationship from the 'Date' column to the 'Start Date' column in my
Stressing table here I also have a 'End Date' column as well as a column for 'Pieces' which are to be stressed in this Oven and an 'Oven ID' column which has a relationship with the 'ID' column of the Oven table and a column named 'Product ID' which has a relationship with the 'Product Name' column of the Product table
Oven table here I have a column for the 'Capacity' of the specific Oven as well as the 'Oven Name' column.
The last table is the Product table it has besides the name just an 'All Pieces' column in which the number of pieces which are to be stressed from this kind of Product are stored. I made it this way because sometimes one product has more pieces to stress than one Oven has capacity.
Any Help is greatly appreciated
Hi Anonymous
You can expand your dates between start and end as per below video
Please see the attached file for ref
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn