{"id":1968,"date":"2019-02-02T15:55:34","date_gmt":"2019-02-02T14:55:34","guid":{"rendered":"http:\/\/didier.terrien.free.fr\/powerbi\/?p=1968"},"modified":"2020-12-16T13:51:22","modified_gmt":"2020-12-16T12:51:22","slug":"2-display-a-light-when-data-is-filtered","status":"publish","type":"post","link":"https:\/\/thebipower.fr\/index.php\/2019\/02\/02\/2-display-a-light-when-data-is-filtered\/","title":{"rendered":"2. Display a light when data is filtered"},"content":{"rendered":"\n<p>When we use a report, it&#8217;s important to know if users applied filters. So, you can display a light when data is filtered. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How to display a light when data is filtered<\/h2>\n\n\n\n<ul><li>First, you create a measure to detect an active filter : <\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>Is table filtered = IF(COUNTROWS(Order_Details) = COUNTROWS(ALL(Order_Details)) ; 0 ; 1)<\/code><\/pre>\n\n\n\n<ul><li>And you create an other measure to detect inactive filters :<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>Is table not filtered = IF(&#91;Is table filtered] ; 0 ; 1) <\/code><\/pre>\n\n\n\n<ul><li>And then, create a fake column :<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>Fake column = \"?\" <\/code><\/pre>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right\" style=\"grid-template-columns:auto 17%\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"177\" height=\"513\" src=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Add-a-100-stacked-bar-chart-to-your-report.png\" alt=\"Add a 100% stacked bar chart to your report to Display a light when data is filtered\" class=\"wp-image-2088\" srcset=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Add-a-100-stacked-bar-chart-to-your-report.png 177w, https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Add-a-100-stacked-bar-chart-to-your-report-104x300.png 104w\" sizes=\"(max-width: 177px) 100vw, 177px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<ul><li>Add a 100% stacked bar chart to your report and set it up this way. It will display a light when data is filtered<\/li><\/ul>\n<\/div><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right\" style=\"grid-template-columns:auto 17%\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"179\" height=\"382\" src=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Modify-data-colors.png\" alt=\"Modify data colors to Display a light when data is filtered\" class=\"wp-image-2079\" srcset=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Modify-data-colors.png 179w, https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Modify-data-colors-141x300.png 141w\" sizes=\"(max-width: 179px) 100vw, 179px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<ul><li>In the format pane, modify data colors<\/li><\/ul>\n\n\n\n<p><\/p>\n<\/div><\/div>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right\" style=\"grid-template-columns:auto 17%\"><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"184\" height=\"707\" src=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Setup-options-this-way.png\" alt=\"Setup options this way\" class=\"wp-image-2091\" srcset=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Setup-options-this-way.png 184w, https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Setup-options-this-way-78x300.png 78w\" sizes=\"(max-width: 184px) 100vw, 184px\" \/><\/figure><div class=\"wp-block-media-text__content\">\n<ul><li>and setup options this way<\/li><\/ul>\n<\/div><\/div>\n\n\n\n<p>From now on, when you will apply any filter, the ligth will turn to green. You can try by selecting any filter in the &#8216;Filters&#8217; page or by selecting a category in your visuals<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"572\" src=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Light-is-green-1024x572.png\" alt=\"\" class=\"wp-image-2095\" srcset=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Light-is-green-1024x572.png 1024w, https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Light-is-green-300x167.png 300w, https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Light-is-green-768x429.png 768w, https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Light-is-green.png 1089w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>And then, you may try to click on the reset button.<\/p>\n\n\n\n<p>In conclusion, if you <font color=\"#000000\"><span style=\"background-color: rgb(225, 190, 231);\">turn on <\/span><\/font>a light when data is filtered, you will catch the attention of your users on the filters they applied. In the next post, you will display these active filters to avoid your users to ask you about it.<\/p>\n\n\n\n<p>Here is the pbix file of the demo :   <a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/didierterrien\/Power-BI-assistant\" target=\"_blank\">download demo &#8216;Report filters.pbix&#8217;<\/a> <\/p>\n\n\n\n<p>This post is a part of a series :   <a href=\"https:\/\/thebipower.fr\/index.php\/category\/power-bi-desktop\/report-filters\/\">see the series<\/a>   &#8211;   <a href=\"https:\/\/thebipower.fr\/index.php\/2019\/02\/03\/3-display-filters-applied-to-data\/\">see next post<\/a><\/p>\n\n\n\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n\t\t\t<div class=\"wp-block-uagb-post-carousel uagb-post-grid  uagb-post__image-position-top uagb-post__image-enabled uagb-block-8f36f7cf     uagb-post__arrow-outside uagb-slick-carousel uagb-post__items uagb-post__columns-3 is-carousel uagb-post__columns-tablet-2 uagb-post__columns-mobile-1\" data-total=\"1\" style=\"\">\n\n\t\t\t\t\t\t\t\t\t\t\t\t<article class=\"uagb-post__inner-wrap\">\t\t\t\t\t\t\t\t<div class='uagb-post__image'>\n\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/thebipower.fr\/index.php\/2019\/05\/03\/5-add-your-filtered-date-range-in-the-tooltip\/\" target=\"_self\" rel=\"bookmark noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"566\" height=\"316\" src=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/05\/Add-your-filtered-date-range-in-the-tooltip.png\" class=\"attachment-large size-large\" alt=\"Add your filtered date range in the tooltip\" srcset=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/05\/Add-your-filtered-date-range-in-the-tooltip.png 566w, https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/05\/Add-your-filtered-date-range-in-the-tooltip-300x167.png 300w\" sizes=\"(max-width: 566px) 100vw, 566px\" \/>\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<h4 class=\"uagb-post__title uagb-post__text\">\n\t\t\t\t<a href=\"https:\/\/thebipower.fr\/index.php\/2019\/05\/03\/5-add-your-filtered-date-range-in-the-tooltip\/\" target=\"_self\" rel=\"bookmark noopener noreferrer\">5. Add your filtered date range in the tooltip<\/a>\n\t\t\t<\/h4>\n\t\t\t\t\t\t<div class='uagb-post__text uagb-post-grid-byline'>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class='uagb-post__text uagb-post__excerpt'>\n\t\t\t\t\t<p>Don&#8217;t forget to add your filtered date range in the tooltip. This is one of&#8230;\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"uagb-post__text uagb-post__cta wp-block-button\">\n\t\t\t\t<a class=\"wp-block-button__link uagb-text-link\" href=\"https:\/\/thebipower.fr\/index.php\/2019\/05\/03\/5-add-your-filtered-date-range-in-the-tooltip\/\" target=\"_self\" rel=\"bookmark noopener noreferrer\">Read More<\/a>\n\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t<\/article>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<article class=\"uagb-post__inner-wrap\">\t\t\t\t\t\t\t\t<div class='uagb-post__image'>\n\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/thebipower.fr\/index.php\/2019\/02\/04\/4-add-a-tooltip-to-display-applied-filters\/\" target=\"_self\" rel=\"bookmark noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"627\" height=\"290\" src=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Display-filters-in-tooltip.png\" class=\"attachment-large size-large\" alt=\"tooltip to display applied filters\" srcset=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Display-filters-in-tooltip.png 627w, https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Display-filters-in-tooltip-300x139.png 300w\" sizes=\"(max-width: 627px) 100vw, 627px\" \/>\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<h4 class=\"uagb-post__title uagb-post__text\">\n\t\t\t\t<a href=\"https:\/\/thebipower.fr\/index.php\/2019\/02\/04\/4-add-a-tooltip-to-display-applied-filters\/\" target=\"_self\" rel=\"bookmark noopener noreferrer\">4. Add a tooltip to display applied filters<\/a>\n\t\t\t<\/h4>\n\t\t\t\t\t\t<div class='uagb-post__text uagb-post-grid-byline'>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class='uagb-post__text uagb-post__excerpt'>\n\t\t\t\t\t<p>Once you know your report is filtered having a look at the green light, you&#8230;\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"uagb-post__text uagb-post__cta wp-block-button\">\n\t\t\t\t<a class=\"wp-block-button__link uagb-text-link\" href=\"https:\/\/thebipower.fr\/index.php\/2019\/02\/04\/4-add-a-tooltip-to-display-applied-filters\/\" target=\"_self\" rel=\"bookmark noopener noreferrer\">Read More<\/a>\n\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t<\/article>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<article class=\"uagb-post__inner-wrap\">\t\t\t\t\t\t\t\t<div class='uagb-post__image'>\n\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/thebipower.fr\/index.php\/2019\/02\/03\/3-display-filters-applied-to-data\/\" target=\"_self\" rel=\"bookmark noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"456\" height=\"294\" src=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Display-filters-applied-to-data.png\" class=\"attachment-large size-large\" alt=\"Display filters applied to data\" srcset=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Display-filters-applied-to-data.png 456w, https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Display-filters-applied-to-data-300x193.png 300w\" sizes=\"(max-width: 456px) 100vw, 456px\" \/>\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<h4 class=\"uagb-post__title uagb-post__text\">\n\t\t\t\t<a href=\"https:\/\/thebipower.fr\/index.php\/2019\/02\/03\/3-display-filters-applied-to-data\/\" target=\"_self\" rel=\"bookmark noopener noreferrer\">3. Display filters applied to data<\/a>\n\t\t\t<\/h4>\n\t\t\t\t\t\t<div class='uagb-post__text uagb-post-grid-byline'>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class='uagb-post__text uagb-post__excerpt'>\n\t\t\t\t\t<p>To understand properly our data, the very first thing we need to do is to&#8230;\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"uagb-post__text uagb-post__cta wp-block-button\">\n\t\t\t\t<a class=\"wp-block-button__link uagb-text-link\" href=\"https:\/\/thebipower.fr\/index.php\/2019\/02\/03\/3-display-filters-applied-to-data\/\" target=\"_self\" rel=\"bookmark noopener noreferrer\">Read More<\/a>\n\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t<\/article>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<article class=\"uagb-post__inner-wrap\">\t\t\t\t\t\t\t\t<div class='uagb-post__image'>\n\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/thebipower.fr\/index.php\/2019\/02\/01\/add-a-filter-page-to-your-report\/\" target=\"_self\" rel=\"bookmark noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"455\" src=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Filters-1-1-1024x455.png\" class=\"attachment-large size-large\" alt=\"Filters\" srcset=\"https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Filters-1-1-1024x455.png 1024w, https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Filters-1-1-300x133.png 300w, https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Filters-1-1-768x342.png 768w, https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Filters-1-1.png 1059w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/>\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<h4 class=\"uagb-post__title uagb-post__text\">\n\t\t\t\t<a href=\"https:\/\/thebipower.fr\/index.php\/2019\/02\/01\/add-a-filter-page-to-your-report\/\" target=\"_self\" rel=\"bookmark noopener noreferrer\">1. Add a filter page to your report<\/a>\n\t\t\t<\/h4>\n\t\t\t\t\t\t<div class='uagb-post__text uagb-post-grid-byline'>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t<div class='uagb-post__text uagb-post__excerpt'>\n\t\t\t\t\t<p>There are different ways to filter data in Power BI reports. My favorite one is&#8230;\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"uagb-post__text uagb-post__cta wp-block-button\">\n\t\t\t\t<a class=\"wp-block-button__link uagb-text-link\" href=\"https:\/\/thebipower.fr\/index.php\/2019\/02\/01\/add-a-filter-page-to-your-report\/\" target=\"_self\" rel=\"bookmark noopener noreferrer\">Read More<\/a>\n\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t<\/article>\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t","protected":false},"excerpt":{"rendered":"<p>When we use a report, it&#8217;s important to know if users applied filters. So, you can display a light when data is filtered. How to display a light when data is filtered First, you create a measure to detect an active filter : And you create an other measure to detect inactive filters : And&#8230;<\/p>\n","protected":false},"author":2,"featured_media":2095,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_uag_custom_page_level_css":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[4],"tags":[48,24,63,41],"uagb_featured_image_src":{"full":["https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Light-is-green.png",1089,608,false],"thumbnail":["https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Light-is-green-150x150.png",150,150,true],"medium":["https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Light-is-green-300x167.png",300,167,true],"medium_large":["https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Light-is-green-768x429.png",768,429,true],"large":["https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Light-is-green-1024x572.png",1024,572,true],"1536x1536":["https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Light-is-green.png",1089,608,false],"2048x2048":["https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Light-is-green.png",1089,608,false],"mailpoet_newsletter_max":["https:\/\/thebipower.fr\/wp-content\/uploads\/2019\/02\/Light-is-green.png",1089,608,false]},"uagb_author_info":{"display_name":"Didier TERRIEN","author_link":"https:\/\/thebipower.fr\/index.php\/author\/masterpower\/"},"uagb_comment_info":0,"uagb_excerpt":"When we use a report, it&#8217;s important to know if users applied filters. So, you can display a light when data is filtered. How to display a light when data is filtered First, you create a measure to detect an active filter : And you create an other measure to detect inactive filters : And...","_links":{"self":[{"href":"https:\/\/thebipower.fr\/index.php\/wp-json\/wp\/v2\/posts\/1968"}],"collection":[{"href":"https:\/\/thebipower.fr\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thebipower.fr\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thebipower.fr\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thebipower.fr\/index.php\/wp-json\/wp\/v2\/comments?post=1968"}],"version-history":[{"count":15,"href":"https:\/\/thebipower.fr\/index.php\/wp-json\/wp\/v2\/posts\/1968\/revisions"}],"predecessor-version":[{"id":3660,"href":"https:\/\/thebipower.fr\/index.php\/wp-json\/wp\/v2\/posts\/1968\/revisions\/3660"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thebipower.fr\/index.php\/wp-json\/wp\/v2\/media\/2095"}],"wp:attachment":[{"href":"https:\/\/thebipower.fr\/index.php\/wp-json\/wp\/v2\/media?parent=1968"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thebipower.fr\/index.php\/wp-json\/wp\/v2\/categories?post=1968"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thebipower.fr\/index.php\/wp-json\/wp\/v2\/tags?post=1968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}