Forum Discussion
Add data if data is missing
- 6 years ago
Hi Anonymous ,
Don't know if the tables are as I have made the setup but try the following:
Tables:
- Employees
- Calendar
- Daily Form Responses
- Rest Day
Relationships:
- Employee 1 -> * Daily Form Responses
- Employee 1 -> * Rest Day
- Calendar 1 -> * Daily Form Responses
Add a column with the weekday on the calendar table and on the Rest day, then make the following measure:
Status_Measure = IF ( MAX ( 'Daily Form Responses'[Status] ) = BLANK (); IF ( SELECTEDVALUE ( 'Calendar'[Weekday] ) = SELECTEDVALUE ( 'Rest Day'[Weekday] ); "OUT OF OFFICE"; "NO ENTRY" ); "SUBMITTED" )Now just add a condittional formatting formula:
Condittional formating = SWITCH ( [Status_Measure]; "NO ENTRY"; "RED"; "OUT OF OFFICE"; "YELLOW"; "GREEN" )Result is below and in attach PBIX file.
Here is one way to approach this:
1. Add a Date column to your Rest Day data (if not there already)
2. Append it to your Daily Form Responses table
3. Sort by Employee Name and Fill down on that column (if that second table really doesn't have name in it)
4. Load the data and make a matrix visual with Employee on the rows, Date on the columns
5. Make a measure like this - Status = IF(ISBLANK(MIN(Daily Form Responses[Status]), "No Entry", MIN(Daily Form Responses[Status]))
If this works for you, please mark it as solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat