conditional formatting
75 TopicsConditional coloring by rank not applying to time-series chart
Hi everyone, my model looks like: I’m using the following measures to color visuals dynamically based on ranking: Rank (Current Axis) = VAR Result = IF ( ISINSCOPE ( fct_amortizedcosts[MeterSubCategory] ), RANKX ( ALLSELECTED ( fct_amortizedcosts[MeterSubCategory] ), CALCULATE ( [Total Amortized Cost] ), , DESC, DENSE ), IF ( ISINSCOPE ( fct_amortizedcosts[MeterCategory] ), RANKX ( ALLSELECTED ( fct_amortizedcosts[MeterCategory] ), CALCULATE ( [Total Amortized Cost] ), , DESC, DENSE ), BLANK () ) ) RETURN Result Color by Rank = VAR r = [Rank (Current Axis)] RETURN SWITCH ( TRUE(), ISBLANK ( r ) || r > 5, "#B3B3B3", r = 1, "#E81123", r = 2, "#107C10", r = 3, "#0078D4", r = 4, "#FFB900", r = 5, "#8E8CD8" ) This works perfectly in donut and bar charts, but when I try to apply the same color logic to a Line and clustered column chart (with Date on the X-axis), all columns turn gray: Has anyone managed to make field value–based coloring work on a time-series chart when the rank is calculated by category (MeterCategory) and not by the date axis? Example mode, use Problem to solve page: https://drive.google.com/file/d/14lpEWK-MQ6JMU5_15WVh8Gv22AiGvdpR/view?usp=drive_link I think that MeterCategory column does not exist in specific visual and this is why visual does not read it as ISINSCOPE function. I tried with HasONeValue but the same i think it is in visual level, not page level filter context...how to pass this ? Thanks for any suggestions!Solved1.1KViews1like6CommentsConditional Formatting in concatenated text
Hey there, looks like I need your help again. These forums are something else, never failed me before. 1. What do we have? There are gates, an there is thing called "readiness". It reflects whether "we" ready to move to the next gate or not. They have their own thresholds. The visual itself are table visual and the columns here are measures based on table columns: Why not just pull column to table visual? Sometimes, there are 2, 3 gates that should be reached at the same time. And they have merged readiness via "concatenation". 2. WHAT I WANT: It is easy to conditionally format when there are but one value present (formatting based on a measure though): But how do I format them when they are merged like this? Keeping in mind that every gate has its own min and max thresholds. Conditional formatting measure example: Conditional Formatting: A = VAR MAX_a_condition = MAXX ( FILTER ( 'Readiness Table', 'Readiness Table'[Gate] = "Start A" ), 'Readiness Table'[max_theshold] ) VAR MIN_a_condition = MAXX ( FILTER ( 'Readiness Table', 'Readiness Table'[Gate] = "Start A" ), 'Readiness Table'[min_threshold] ) RETURN SWITCH ( TRUE (), OR( ISBLANK([A Readiness]), [A Readiness] = "Not Applicable"), BLANK(), [A Readiness] < MIN_alpha_condition , "FlagLow", [A Readiness] > MAX_alpha_condition , "FlagHigh", "FlagMedium" ) It is okay if there is no way of doing it... But there might be some?Solved3.3KViews0likes6CommentsColor Picker without color palette, need to have only conditional formatting button
Hello All, I am currently working on custom visual formatting pane to add a color picker without the color palette button (color dropdown next to `fx` button), just need to have conditional formatting button (this fx button) Current UI looks like Expected (This is from Table visual > Format Pane > Cell Element Card) I am currently using "Color Picker slice" and this is my code in capabilities "objects": { "values": { "properties": { "conditionalColor": { "type": { "fill": { "solid": { "color": true } } } } } } }Conditional format latest value per user
I'm working on a report which pulls together several sources of training data. One of the widgets we need is for new employees working through the training program and capturing their training events by week. The ask from stakeholders is to color code a given user's lastest training week which I felt I could accomplish from conditional formatting. I have the following formulas: 1. Week of Training Week of Training = var saturdaybefore = CALCULATE (MIN('Employee'[Proficiency Training Start Date]) - WEEKDAY(MIN('Employee'[Proficiency Training Start Date]), 2))-1 RETURN IF(YEAR(saturdaybefore) < YEAR(MIN('Employee'[Proficiency Training Start Date])), BLANK(), ROUNDUP(DIVIDE(DATEDIFF(saturdaybefore, 'Data'[Date of Training], Day),7), 0)) 2. I then created a measure to assess the max week of each user: Measure = var maxweek = CALCULATE( MAXX('Data',[Week of Training] ), ALLEXCEPT(Data', 'Data'[USERNAME]) ) RETURN IF(ISBLANK(maxweek), 0, IF(Max('Data'[Week of Training]) =maxweek, 2, 1) ) I want to color a given user's maximum week orange. I thought I could accompish doing this with my measure above and setting 2 to be orange (the field format is number), but it's only formatting the absolute latest training date (e.g., green box value) and not everyone's latest training week date (e.g. red box values). I realize I am currently using gradient conditional formatting but it shouldn't affect that the latest training week for a user isn't shading properly. Here's some truncated sample data to show you my measure is working properly: USERNAME Date of Training SYSID Proficiency Start Date Week of Training Measure user1 11/6/2024 00:00 8609789 0 user2 1/21/2025 00:00 9043094 10/7/2024 00:00 16 2 user2 12/15/2024 00:00 8873091 10/7/2024 00:00 11 1 user2 12/11/2024 00:00 8850769 10/7/2024 00:00 10 1 user2 12/11/2024 00:00 8850741 10/7/2024 00:00 10 1 user2 12/2/2024 00:00 8786133 10/7/2024 00:00 9 1 user2 12/1/2024 00:00 8777767 10/7/2024 00:00 9 1 user2 12/1/2024 00:00 8777763 10/7/2024 00:00 9 1 user2 11/30/2024 00:00 8775141 10/7/2024 00:00 8 1 user2 11/30/2024 00:00 8775133 10/7/2024 00:00 8 1 user2 11/27/2024 00:00 8760819 10/7/2024 00:00 8 1 user2 11/17/2024 00:00 8684304 10/7/2024 00:00 7 1 user2 11/13/2024 00:00 8659422 10/7/2024 00:00 6 1 user2 11/4/2024 00:00 8592577 10/7/2024 00:00 5 1 user2 11/3/2024 00:00 8584769 10/7/2024 00:00 5 1 user2 10/30/2024 00:00 8565134 10/7/2024 00:00 4 1 user2 10/30/2024 00:00 8565131 10/7/2024 00:00 4 1 user2 10/30/2024 00:00 8565127 10/7/2024 00:00 4 1 user2 10/24/2024 00:00 8526851 10/7/2024 00:00 3 1 user2 10/22/2024 00:00 8505041 10/7/2024 00:00 3 1 user2 10/22/2024 00:00 8505026 10/7/2024 00:00 3 1 user2 10/16/2024 00:00 8467188 10/7/2024 00:00 2 1 user2 10/16/2024 00:00 8467188 10/7/2024 00:00 2 1 user2 10/16/2024 00:00 8467188 10/7/2024 00:00 2 1 user2 10/11/2024 00:00 8439690 10/7/2024 00:00 1 1 user2 10/11/2024 00:00 8439690 10/7/2024 00:00 1 1 user3 12/14/2024 00:00 8870221 10/7/2024 00:00 10 2 user3 12/8/2024 00:00 8827785 10/7/2024 00:00 10 2 user3 12/5/2024 00:00 8807877 10/7/2024 00:00 9 1 user3 12/4/2024 00:00 8807664 10/7/2024 00:00 9 1 user3 12/4/2024 00:00 8806990 10/7/2024 00:00 9 1 user3 11/26/2024 00:00 8744739 10/7/2024 00:00 8 1 user3 11/25/2024 00:00 8737160 10/7/2024 00:00 8 1 user3 11/24/2024 00:00 8732020 10/7/2024 00:00 8 1 user3 11/23/2024 00:00 8731822 10/7/2024 00:00 7 1 user3 11/20/2024 00:00 8710436 10/7/2024 00:00 7 1 user3 11/10/2024 00:00 8633342 10/7/2024 00:00 6 1 user3 11/10/2024 00:00 8633326 10/7/2024 00:00 6 1 user3 11/9/2024 00:00 8630349 10/7/2024 00:00 5 1 user3 11/6/2024 00:00 8603308 10/7/2024 00:00 5 1 user3 11/1/2024 00:00 8578294 10/7/2024 00:00 4 1 user3 10/23/2024 00:00 8517792 10/7/2024 00:00 3 1 user3 10/22/2024 00:00 8509909 10/7/2024 00:00 3 1 user3 10/19/2024 00:00 8488369 10/7/2024 00:00 2 1 user3 10/19/2024 00:00 8488358 10/7/2024 00:00 2 1 user3 10/9/2024 00:00 8425942 10/7/2024 00:00 1 1529Views0likes3CommentsConditional formatting highlighting selected value in slicer
I would like to use conditional formatting to highlight a specific bar in my bar chart, based on the value I have selected in my slicer. All over the internet, I find the same DAX formula which is the following: HighlightCompany = IF( SELECTEDVALUE(Company[CompanyName]) = MAX(Company[CompanyName]), 1, // This means the company is selected, and it will be highlighted 0 // This means the company is not selected ) Although, when I do this DAX formula, all bars are highlighted. I thought it might've been because my slicer is not filtering the bar chart, although when I choose to filter the bar chart, it only shows the selected company in the bar chart, without all the other companies. Here are some pictures: In this one, the selected company (on the left) only returns that company in the bar chart (on the right). In this one, the selected company (on the left) returns all companies on the right, without highlighting the selected company. When I use a dax formula, either one of both pops up, and not a combination of both. Does anyone have the same issue or have a solution for this problem? Thank you in advance!Solved1.7KViews0likes7CommentsIndividual Row Colors in Matrix
Hello! I am attempting to color individual rows of a matrix. I understand this is not currently a feature in Power BI, but using this YouTube video, I was able to find a work around. I used the below measure, which I used as Conditional Formatting, to color the rows based on the HEX color listed in each row of the measure. However, this seems to exclude cells with a zero/blank value. How can I modify the below measure to ensure all cells for each row have the same formatting? For instance, "In Transit Receipts" shows many white cells because they have no value. I would like these cells to be the same light blue color as the cells with a value. Metric Colors = SWITCH( TRUE(), MAX('APO Monthly'[MetricNew])="Forecast","#d9e1f2", MAX('APO Monthly'[MetricNew])="Sales Order","#d9e1f2", MAX('APO Monthly'[MetricNew])="Global Sales Orders","#d9e1f2", MAX('APO Monthly'[MetricNew])="Global Forecast","#d9e1f2", MAX('APO Monthly'[MetricNew])="DI Forecast","#e6e6e6", MAX('APO Monthly'[MetricNew])="Stock Transfer (Out)","White", MAX('APO Monthly'[MetricNew])="SAP Suggested Buy","#e6e6e6", max('APO Monthly'[MetricNew])="In Transit Receipts","#d9e1f2", MAX('APO Monthly'[MetricNew])="Confirmed Receipts","#d9e1f2", MAX('APO Monthly'[MetricNew])="Additional Confirmed Receipts (Inc STO In)","#d9e1f2", MAX('APO Monthly'[MetricNew])="Total Demand","#09124f", MAX('APO Monthly'[MetricNew])="Total Receipts","#09124f", max('APO Monthly'[MetricNew])="Stock On Hand (Projected)","#055201", "White" ) Thank you!Solved1.9KViews0likes4CommentsDynamic formatting not showing the correct currency in Excel
Hi team, I am using the dynamic formatting for a switch measure to ensure to display the data in correct format according to the selected measure. It works all fine until I visualise the data in Excel. I get £ sign instead of $ sign. Here is the dynamic formatting code: SWITCH( TRUE(), [SelectedMeasure] = 1, "$#,##0", // Revenue [SelectedMeasure] = 2, "#,##0", // Units [SelectedMeasure] = 3, "#,##0", // Accounts [SelectedMeasure] = 4, "$#,##0", // ADS Revenue [SelectedMeasure] = 5, "#,##0", // ADS Units [SelectedMeasure] = 6, "$#,##0", // Revenue On Pace [SelectedMeasure] = 7, "#,##0", // Units On Pace [SelectedMeasure] = 8, "$#,##0", // ASP [SelectedMeasure] = 9, "#,##0", // Units / Account [SelectedMeasure] = 11, "0%", // IVL/PCI% [SelectedMeasure] = 12, "0%", // IVL/ROTA% [SelectedMeasure] = 13, "$#,##0", // Revenue (actual fx) [SelectedMeasure] = 14, "#,##0", // Units Coronary [SelectedMeasure] = 15, "#,##0", // Units Peripheral [SelectedMeasure] = 16, "#,##0", // Orders [SelectedMeasure] = 18, "$#,##0", // Revenue Coronary [SelectedMeasure] = 19, "$#,##0", // Revenue Peripheral [SelectedMeasure] = 20, "#,##0", // Units FOC [SelectedMeasure] = 21, "0%", // Units FOC % [SelectedMeasure] = 22, "0%", // C2/PCI% [SelectedMeasure] = 23, "0%", // C2/ROTA% "General" // Default format ) I tried adding FORMAT([SelectedMeasure]) but it returns wrong results. Kindly advise, Best regards, HugoSolved1.2KViews0likes2CommentsCreate Conditional Formatting Group
Hi, I'm trying to create a Conditional Formatting Group in the Customization tab like in the table visual: I thought I may be able to use the ConditionalFormattingControl as the Formatting Component but couldn't find anywhere how to insert it to the pane. Can someone provide an example on how to create something similar? Is it even possible? I want to create a status field that can be formatted as we do in the table visual, so I will want to know how to apply those to my Visual. Thanks in advance!Conditional formatting matrix for Multiple Columns based on week
Hi! Hopefully someone can help. I am struggling to recreate something that was previously done in excel into a Matrix visual in one of my reports. Basically, I am trying to display gradient colors using conditional formatting based on the values for multiple columns. In excel, we used conditional formatting for each individual column multiple times. When I attempt to use conditional formatting in Power Bi, the entire dataset is used in the gradient rather than each individual column. I have also tried creating a color table using dax and then use a gradient color measure within field value but the colors are all over the place. Does anyone have any suggestions?