cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Eivindeiki
Frequent Visitor

Custom column - Work rotation schedule

Hi Community, 

I need your help to get the work rotation schedule like in the example below. I have tried using a custom column in the query editor, but without luck. Any suggestions? 

 

Eivindeiki_1-1639736478699.png

Eivindeiki_2-1639736756820.png

 

 

Eivindeiki_0-1639736345351.png

 

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Eivindeiki ,

If you use Matrix ,it with some limitations,and I suggest you to merge the column "off""on""start_date""end_date".

base table:

 

vluwangmsft_1-1640161171728.png

vluwangmsft_2-1640161179961.png

 

ON|OFF|START|END = TableB[On]&"|"&TableB[off] &"|"&TableB[start]&"|"&TableB[end]

 

vluwangmsft_0-1640161134004.png

Base on tableA create the following tables:

Tableon = CALCULATETABLE(TableA,FILTER(TableA,TableA[on/off]="on"))
Tableoff = CALCULATETABLE(TableA,FILTER(TableA,TableA[on/off]="off"))

 

Then use the below measure:

xvalue = 
IF(LOOKUPVALUE(Tableoff[Date],Tableoff[Date],MAX(TableB[Date]))<>blank(),"x",IF(LOOKUPVALUE(Tableon[Date],Tableon[Date],MAX(TableB[Date]))<>blank(),"-",BLANK()))
color = 
IF(LOOKUPVALUE(Tableon[Date],Tableon[Date],MAX(TableB[Date]))<>blank(),"Orange",BLANK())

Create matrix and set color:

vluwangmsft_3-1640161274604.png

vluwangmsft_4-1640161286712.png

Final output:

vluwangmsft_5-1640161310097.png

 

You could download my pbix file if you need!

 

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @Eivindeiki ,

If you use Matrix ,it with some limitations,and I suggest you to merge the column "off""on""start_date""end_date".

base table:

 

vluwangmsft_1-1640161171728.png

vluwangmsft_2-1640161179961.png

 

ON|OFF|START|END = TableB[On]&"|"&TableB[off] &"|"&TableB[start]&"|"&TableB[end]

 

vluwangmsft_0-1640161134004.png

Base on tableA create the following tables:

Tableon = CALCULATETABLE(TableA,FILTER(TableA,TableA[on/off]="on"))
Tableoff = CALCULATETABLE(TableA,FILTER(TableA,TableA[on/off]="off"))

 

Then use the below measure:

xvalue = 
IF(LOOKUPVALUE(Tableoff[Date],Tableoff[Date],MAX(TableB[Date]))<>blank(),"x",IF(LOOKUPVALUE(Tableon[Date],Tableon[Date],MAX(TableB[Date]))<>blank(),"-",BLANK()))
color = 
IF(LOOKUPVALUE(Tableon[Date],Tableon[Date],MAX(TableB[Date]))<>blank(),"Orange",BLANK())

Create matrix and set color:

vluwangmsft_3-1640161274604.png

vluwangmsft_4-1640161286712.png

Final output:

vluwangmsft_5-1640161310097.png

 

You could download my pbix file if you need!

 

 

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

amitchandak
Super User
Super User

@Eivindeiki , you have try a approch like

Matrix as Project plan Visual: https://youtu.be/R25QoiyoSVs

 

 

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!