Forum Discussion
Conditional Formatting based on Slicer
- Anonymous3 years ago
HI hasharma19,
You can use the following measure formula at 'conditional formatting' ->'font color' with 'field value' mode to setting color formatting based current Facility and Section:
Colorcode = VAR currFacility = SELECTEDVALUE ( 'Table'[Facility] ) VAR currSection = SELECTEDVALUE ( 'Table'[Section] ) VAR summary = SUMMARIZE ( ALLSELECTED ( 'Table' ), [Facility], [Section], "SC", COUNT ( 'Table'[Section] ) ) VAR rowCount = COUNTROWS ( FILTER ( summary, [Facility] = currFacility && [Section] = currSection && [SC] > 1 ) ) RETURN IF ( rowCount > 0, "Red", "Black" )Apply conditional table formatting in Power BI - Power BI | Microsoft Learn
Regards,
Xiaoxin Sheng
Hi,
Please find the data
Result needed, if in section(highlighted column) same topic will come for any particular location so that the value should be highligt in Red while selecting through slicer and in case none of location slected or multiple location selected resulted shold be default(value in black color)
| Sr No. | Date | Region | Facility | Review Question # | Section | Remarks | GAP | Level | Status | Closure Date | Submitted On | Year | Column |
| 1 | 13-Feb-22 | North | DEL NOY | 05-04-2022 | Minimum requirements - Warehouse | DG & LiBa Stickers | GAP1 | Level1 | Close | 14-02-2022 | 14-10-2022 14:16:12 | 2022 | 2 |
| 2 | 20-Jan-22 | North | DEL RPO | 01-04-2022 | Minimum requirements - Warehouse | DG labels & Incompatibility poster | GAP1 | Level1 | Close | 31-01-2022 | 14-10-2022 14:18:37 | 2022 | 2 |
| 3 | 18-Jan-22 | North | DEL FDB | 03-01-2022 | General | Test & Certificates not available | GAP1 | Level1 | Close | 28-01-2022 | 14-10-2022 14:22:13 | 2022 | 2 |
| 4 | 31-Jan-22 | South | BLR BG1 | Emergency Procedures - Reporting | BG1 facility not tagged in RCIR | GAP1 | Level1 | Close | 10-02-2022 | 14-10-2022 14:24:00 | 2022 | 3 | |
| 5 | 08-Jan-22 | South | MAA EGM | 02-10-2022 | Emergency Procedures - Reporting | Emergency Contact Numbers not visible | GAP1 | Level1 | Close | 18-01-2022 | 14-10-2022 14:25:38 | 2022 | 3 |
| 6 | 21-Jan-22 | South | BLR HSR | 01-04-2022 | Minimum requirements - Warehouse | DG labels & Incompatibility poster | GAP1 | Level1 | Close | 02-02-2022 | 14-10-2022 14:29:24 | 2022 | 2 |
| 7 | 21-Jan-22 | South | BLR HSR | 02-10-2022 | Emergency Procedures - Reporting | Emergency Contact Details | GAP2 | Level1 | Close | 02-02-2022 | 14-10-2022 14:33:28 | 2022 | 3 |
| 8 | 09-Feb-22 | South | MAA GYO | Road Operations | CAT 12 Training for X Ray Screener | GAP1 | Level1 | Close | 19-02-2022 | 14-10-2022 14:35:34 | 2022 | 1 | |
| 9 | 09-Feb-22 | South | MAA GYO | Load Control and Ramp Procedures | To nominate at least one SVC Supervisor for CAT-6 | GAP2 | Level1 | Close | 19-02-2022 | 14-10-2022 14:36:52 | 2022 | 1 | |
| 10 | 09-Feb-22 | South | MAA GYO | Acceptance & Handling Procedures | DG acceptance sticker & LiBA. Both stickers are mixed | GAP3 | Level1 | Close | 19-02-2022 | 14-10-2022 14:39:48 | 2022 | 1 | |
| 11 | 15-Jan-22 | West | BOM VSO | Minimum Training Requirements | CAT 6 validity expired | GAP1 | Level1 | Close | 25-01-2022 | 14-10-2022 14:43:52 | 2022 | 1 | |
| 12 | 15-Feb-22 | West | BOM MPT | 06-01-2022 | General | CAT 4,5,7 Training Pending for 3 Staff | GAP1 | Level1 | Close | 25-02-2022 | 14-10-2022 14:46:12 | 2022 | 2 |
| 13 | 15-Feb-22 | West | BOM MPT | SLAs/Contracts | CAT 4,5,7 Training Pending for 3 Staff | GAP2 | Level1 | Close | 25-02-2022 | 14-10-2022 14:49:42 | 2022 | 1 | |
| 14 | 15-Feb-21 | West | BOM MPT | 06-01-2022 | General | CAT 4,5,7 Training Pending for 3 Staff | GAP2 | Level1 | Close | 20-08-2021 | 28-10-2022 14:16:57 | 2021 | 2 |
HI hasharma19,
You can use the following measure formula at 'conditional formatting' ->'font color' with 'field value' mode to setting color formatting based current Facility and Section:
Colorcode =
VAR currFacility =
SELECTEDVALUE ( 'Table'[Facility] )
VAR currSection =
SELECTEDVALUE ( 'Table'[Section] )
VAR summary =
SUMMARIZE (
ALLSELECTED ( 'Table' ),
[Facility],
[Section],
"SC", COUNT ( 'Table'[Section] )
)
VAR rowCount =
COUNTROWS (
FILTER (
summary,
[Facility] = currFacility
&& [Section] = currSection
&& [SC] > 1
)
)
RETURN
IF ( rowCount > 0, "Red", "Black" )
Apply conditional table formatting in Power BI - Power BI | Microsoft Learn
Regards,
Xiaoxin Sheng