filters
121 TopicsLine Segment and Legend Color Based on Measures
Conditional formatting in Power BI just got a solid upgrade. In the July 2026 update, conditional formatting now works on Line Charts and visuals with Legends. This was one of the most requested features. It lets you apply data-driven colors across multiple visual types and keep colors consistent throughout your reports. Up until recently, when I used to interview Power BI professionals with a lot of experience in visualization, I had a good way to test them. I'd ask one of these questions: Which visuals don't support conditional formatting? I made some changes to my visual and now the conditional formatting option isn't showing. Why? How do you apply conditional formatting on Line and Pie visuals? It was an easy way to catch gaps. Conditional formatting wasn't supported on legends. For Pie visuals, the workaround was to apply it on a Bar chart first and then switch to Pie. For Line visuals, we used to get extra color markers the same way. Power BI has been improving its visualization experience steadily over the last two years, with big updates coming regularly. This long-awaited feature finally made it into the July 2026 update. Conditional formatting is now supported on Line visuals and Legends. Why it was needed on Line visuals Just like any other visual, you sometimes need line segments to change color based on a condition. This helps explain things like margins going down or current year vs previous year comparisons. Why it was needed on Legends Say your company always uses one color and your competitor uses another. On a report showing market share, you'd always want your company represented by the same color. That was possible for axis values but not for legends. This update fixes that. You can now apply conditional formatting on Pie, Stacked, and any other visual that uses a legend. Please find the file where I have used different measures to do conditional formatting on Line and Legends Measure used Brand Color = SWITCH ( TRUE (), Max('Item'[Brand])= "Brand 1", "Yellow", Max('Item'[Brand])= "Brand 2", "Green", Max('Item'[Brand])= "Brand 3", "Blue", Max('Item'[Brand])= "Brand 4", "Red", Max('Item'[Brand])= "Brand 5", "Orange", Max('Item'[Brand])= "Brand 6", "Purple", Max('Item'[Brand])= "Brand 7", "Pink", Max('Item'[Brand])= "Brand 8", "Cyan", Max('Item'[Brand])= "Brand 9", "Lime", Max('Item'[Brand])= "Brand 10", "Brown", Max('Item'[Brand])= "Brand 11", "Gray", Max('Item'[Brand])= "Brand 12", "Teal", Max('Item'[Brand])= "Brand 13", "Magenta", "Other" ) Category Measure Category Color = SWITCH ( TRUE (), Max('Item'[Category] )= "Category 1", "Red", Max('Item'[Category] )= "Category 2", "Green", Max('Item'[Category] )= "Category 3", "Blue", Max('Item'[Category] )= "Category 4", "Yellow", Max('Item'[Category] )= "Category 5", "Orange", "Black" ) Color Year Max Year = max('Date'[Year]) You can also check the video on the same - https://www.youtube.com/watch?v=SDX1gUpcJaw&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L&index=139Views0likes0CommentsVisual-level filters disappear after republishing from Power BI Desktop
In Power BI Desktop, I added a new section to my existing dashboard. For this section, I copied visuals from a previous section, renamed them, changed the fields to new dataset fields, and applied new visual-level filters using the Filters pane. Everything looks correct in Desktop, but after publishing the updated report to the Power BI Service, the new filters are missing. If I publish the same report as a new one to a different workspace, the filters appear correctly. Has anyone faced this issue before or know how to fix it without deleting and republishing the report?Solved4.1KViews1like11CommentsBetter Rolling Average
Continuing with exploring alternatives to Power BI's default quick measures that don't involve the CALCULATE function, such as Better Running Total, Better Average per Category, Better Weighted Average per Category, Better Filtered Value, Better Sales from New Customers, and Year to Date Total and Year Over Year Change, this one tackles Rolling Average. Power BI's Rolling Average quick measure returns something like this: Value rolling average = IF( ISFILTERED('Dates'[Date]), ERROR("Time intelligence quick measures can only be grouped or filtered by the Power BI-provided date hierarchy or primary date column."), VAR __LAST_DATE = ENDOFMONTH('Dates'[Date].[Date]) VAR __DATE_PERIOD = DATESBETWEEN( 'Dates'[Date].[Date], STARTOFMONTH(DATEADD(__LAST_DATE, -3, MONTH)), __LAST_DATE ) RETURN AVERAGEX( CALCULATETABLE( SUMMARIZE( VALUES('Dates'), 'Dates'[Date].[Year], 'Dates'[Date].[QuarterNo], 'Dates'[Date].[Quarter], 'Dates'[Date].[MonthNo], 'Dates'[Date].[Month] ), __DATE_PERIOD ), CALCULATE(SUM('Table'[Value]), ALL('Dates'[Date].[Day])) ) ) Perhaps a better way: Better Rolling Average = VAR __EndDate = MAX('Table'[Date]) VAR __3MonthsAgo = EOMONTH(__EndDate, -3) VAR __StartDate = DATE(YEAR(__3MonthsAgo), MONTH(__3MonthsAgo), 1) VAR __Table = SUMMARIZE( FILTER(ALL('Table'),[Date]>=__StartDate && [Date]<=__EndDate), 'Table'[Month], "__Value",SUM('Table'[Value]) ) RETURN AVERAGEX(__Table,[__Value]) And the video: eyJrIjoiZjc5MDlhYjktOWYzZi00YzM3LWFlYWEtYWMyMGQyNzM4NGYwIiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN95.1KViews2likes1CommentPatient Cohort (AND Slicer)
In the healthcare field, it is often desireable to identify a cohort of patients with similar, multiple diagnoses. This quick measure returns a comma-delimited list of patients that have all been identified with the same diagnoses. The tricky part here is that this allows the user to select from a slicer the diagnoses for which the user is interested in obtaining a cohort. Identified patients have had diagnoses that meet all of the selected criteria. In other words, all patients have had diagnoses for all of the selected diagnoses in the slicer. Essentially creates an AND for the slicer as opposed to the normal OR. Cohort = VAR tmpTable1 = GENERATE(VALUES(Diagnosis[Patient]), EXCEPT( VALUES(Diagnosis[Diagnosis]), CALCULATETABLE(VALUES(Diagnosis[Diagnosis])))) VAR tmpTable2 = SUMMARIZE(tmpTable1,Diagnosis[Patient]) VAR tmpTable3 = EXCEPT(VALUES(Diagnosis[Patient]),tmpTable2) RETURN CONCATENATEX(tmpTable3,[Patient],",") This quick measure would take two inputs, the column for the ID to return (Patient) and the column for the slicer selection (Diagnosis) Also included is the trivial variation, Count of Cohort: Count of Cohort = VAR tmpTable1 = GENERATE(VALUES(Diagnosis[Patient]), EXCEPT( VALUES(Diagnosis[Diagnosis]), CALCULATETABLE(VALUES(Diagnosis[Diagnosis])))) VAR tmpTable2 = SUMMARIZE(tmpTable1,Diagnosis[Patient]) VAR tmpTable3 = EXCEPT(VALUES(Diagnosis[Patient]),tmpTable2) RETURN COUNTROWS(tmpTable3) eyJrIjoiZWYwNzZlNzctOTc5NC00ZWU1LWI2OWMtYTZjYTI0MjIzMjEzIiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN99.4KViews9likes8Commentscreate measures with filters
Hello, I need to create measures using some filter to be able to make some card visuals. here is what I did: I have my date base with all years information, so for making the "sales per year" i made to measures: 2025 = SUM(...) and filtered in 2025 poryjected sales. 2024 = CALCULATE([Facturación],SAMEPERIODLASTYEAR('Calendar'[Date])) - I created a measure of get the sales of previous year. than I made a measure to get the difference between both 2024 adn 2025 sales. WHAT I SHOULD DO: I made to charts one "increasing of sales" detailed all the "clientes" that has a positive result and I was using the filter panel. and another of "lost sales" with all the negative results. I need to add some cards to summarize the totals. I have one showing the total of sales in 2025 I need a card showing the total of increaisng sales that is "2,066,314" and a card showing the total of lost sales that is "-919,865" thank you!Solved774Views0likes2CommentsMeasures using filters of negative and positive results
Hello, would like to know how can I make measures with calculations but using filters. here is an example of what I pretend to do I have the sales per country on 2023 and 2024. I am comparing them. so I was thinking to make a measure to show only the countrys that has losing of sales . and another measure that let me show only the countries having an increase of sale with no return of the negative numbers. I think I need to make measures because at the end I need to make a comparative chart showing the losing sales and the increase of sales with the sales of previous year. COUNTRY 2023 2024 Difference USA $5,000 $4,300 -$700 FRANCE $5,000 $5,000 $0 GERMANY $3,500 $2,000 -$1,500 MEXICO $600 $1,200 $600 ITALY $5,500 $5,300 -$200 CHINA $5,000 $3,000 -$2,000 JAPAN $5,000 $4,580 -$420 AUSTRALIA $6,000 $6,100 $100 TOTAL $35,600 $31,480 -$4,120 NEW MEASURES Lost Sales Increase of sales: USA -$700 MEXICO $600 GERMANY -$1,500 AUSTRALIA $100 CHINA -$2,000 $700 JAPAN -$420 -$4,620 FINAL CHART I NEED TO ACHIEVE 2023 LOST SALE INCREASE OF SALES $35,600 -$4,620 $700 thank you!Solved679Views0likes2CommentsDAX Getting Same Grand Total Amount in Each Row
If I select 'Current Hierarchy'[Sales Code] and 'Quota Results'[Location Quota], it displays the correct results row by row. But I have onother table called 'BCP' which has a [Sales Code]. When I select it with Location Quota it gives me the same grand total in each row. So I created a relationship between 'Current Hierarchy'[Sales Code] and 'BCP'[Sales Code]. But the results are still the same. Any idea how to fix?Solved1.1KViews0likes4CommentsEmbed For Customer - All Pages Filter
I have two clients viewing functionally the same report in an embed for your customers scenario. I was asked if each client could be made to see only their own data exclusively. I can easily make this work with an "all pages" filter, which to my knowledge can't be edited or removed from the embedded view (unlike a page filter which can be). However I'm concerned that this approach is not secure. Does Powerbi Provide any guarantee that "All pages" filters cannot be edited or modified from an embedded view? Is the "Hide Filters" button sufficent for this?Solved1.1KViews0likes2CommentsDashboard Template
A Power BI template featuring a heatmap as a calendar-formatted matrix and buttons that reference bookmarks for day, week, month, quarter, and year to adjust the date timeline selection and the X-axis date hierarchy on trend charts. It includes date filtering options based on timeframes and ageing. This template was developed for on-premises Power BI Report Server but also works in the Service. The test data was created by using https://mockaroo.com/ .9.2KViews1like0CommentsVisuals not displaying any data
Hello everyone, I've built a report that is to be used to summarise various economic data. I have been trying to add a slicer into my Power BI report to filter by country across all pages. I had managed to do this, but as soon as I deselected that country and chose another, the visuals wouldn't load. Having deleted the slicer, I cannot revert back either and now all visuals (charts/graphs) that would have been affected by the fitler are now blank. How do I rectify this? - My look clean (None across all pages, 'all' selected on each visual, etc.) - Table mapping of relationships appears correct - Table validation is also okay (e.g. for Italy there is GDP data, it just won't show in the visual) Am I missing something obvious? Thanks in advance!