Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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 @Anonymous ,

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 @Anonymous ,

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

@Anonymous , you have try a approch like

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

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.