Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
ERing
Post Patron
Post Patron

Possible to hide specific values in a table? Conditional Formatting?

I recently built a simple report like below and my stakeholder for the report would like to hide specific values in the report.

Currently, I'm using a text box to hide the values, but the text boxes will be in the wrong place is a user changes the sorting.

Is there anyway I can hide specific values in a table? It doesn't have to show "N/A", although that would be preferred.

Sample File 

 

Conditional Formatting Example.png

2 ACCEPTED SOLUTIONS
OwenAuger
Super User
Super User

Hi @ERing 

A nice method here might be to use a calculation group to override the measure values.

I've attached an updated PBIX.

 

1. Create a calculation group called 'Measure Display' with a calculation item column 'Measure Display Option', containing a calculation item 'Hide Specific Values'.

The expression for this calculation item could be:

VAR MeasureChannelToHide =
    {
        ( "Web Sessions", "Display" ),
        ( "Web Sessions", "Organic" ),
        ( "Web Sessions to Web Initiations Conversion Baseline", "Organic" )
    }
VAR CurrentMeasureName = SELECTEDMEASURENAME ( )
VAR CurrentChannel = SELECTEDVALUE ( 'Channel Mapping'[Channel] )
VAR Result =
    IF (
        AND (
            ISINSCOPE ( 'Channel Mapping'[Channel] ),
            ( CurrentMeasureName, CurrentChannel ) IN MeasureChannelToHide
        ),
        "N/A",
        SELECTEDMEASURE ( )
    )
RETURN
    Result

You may want to adjust or remove the ISINSCOPE condition. As it stands, it will only hide the measure on the row of the specific Channel, not the total row (in case a single Channel is filtered).

 

2. Apply this calculation item as a filter on the required visuals/pages/report.

OwenAuger_0-1744085992705.png

Is this the sort of thing you were looking for?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

ajaybabuinturi
Resolver I
Resolver I

Hi @ERing,

I would like to suggest you to tweak your measures as follows that will achieve your requirement.

Web Sessions1 = IF(SELECTEDVALUE('Channel Mapping'[Channel]) IN {"Display", "Organic"}, //Add required channels
BLANK(), //True Result. If you need any other Text, that will be as "Test"  
sum(Web_Sessions[Web Sessions])) //False Result
Web Sessions to Initiations % = 
Var Result = DIVIDE('Measures Table'[Web Initiations Baseline],'Measures Table'[Web Sessions Baseline], BLANK())

vAR Final_Result = IF(SELECTEDVALUE('Channel Mapping'[Channel]) = "Organic", //Add required channels
BLANK(), //True Result. If you need any other Text, that will be as "N/A"  
Result) //False Result

RETURN
Final_Result

ajaybabuinturi_0-1744093967101.png

Click here to download .pbix file 

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

View solution in original post

4 REPLIES 4
ajaybabuinturi
Resolver I
Resolver I

Hi @ERing,

I would like to suggest you to tweak your measures as follows that will achieve your requirement.

Web Sessions1 = IF(SELECTEDVALUE('Channel Mapping'[Channel]) IN {"Display", "Organic"}, //Add required channels
BLANK(), //True Result. If you need any other Text, that will be as "Test"  
sum(Web_Sessions[Web Sessions])) //False Result
Web Sessions to Initiations % = 
Var Result = DIVIDE('Measures Table'[Web Initiations Baseline],'Measures Table'[Web Sessions Baseline], BLANK())

vAR Final_Result = IF(SELECTEDVALUE('Channel Mapping'[Channel]) = "Organic", //Add required channels
BLANK(), //True Result. If you need any other Text, that will be as "N/A"  
Result) //False Result

RETURN
Final_Result

ajaybabuinturi_0-1744093967101.png

Click here to download .pbix file 

Thanks,
If you found this solution helpful, please consider giving it a Like👍 and marking it as Accepted Solution✔. This helps improve visibility for others who may be encountering/facing same questions/issues.

OwenAuger
Super User
Super User

Hi @ERing 

A nice method here might be to use a calculation group to override the measure values.

I've attached an updated PBIX.

 

1. Create a calculation group called 'Measure Display' with a calculation item column 'Measure Display Option', containing a calculation item 'Hide Specific Values'.

The expression for this calculation item could be:

VAR MeasureChannelToHide =
    {
        ( "Web Sessions", "Display" ),
        ( "Web Sessions", "Organic" ),
        ( "Web Sessions to Web Initiations Conversion Baseline", "Organic" )
    }
VAR CurrentMeasureName = SELECTEDMEASURENAME ( )
VAR CurrentChannel = SELECTEDVALUE ( 'Channel Mapping'[Channel] )
VAR Result =
    IF (
        AND (
            ISINSCOPE ( 'Channel Mapping'[Channel] ),
            ( CurrentMeasureName, CurrentChannel ) IN MeasureChannelToHide
        ),
        "N/A",
        SELECTEDMEASURE ( )
    )
RETURN
    Result

You may want to adjust or remove the ISINSCOPE condition. As it stands, it will only hide the measure on the row of the specific Channel, not the total row (in case a single Channel is filtered).

 

2. Apply this calculation item as a filter on the required visuals/pages/report.

OwenAuger_0-1744085992705.png

Is this the sort of thing you were looking for?


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

@OwenAuger  Yes, this is what I was looking for.  Would it be possible to add red/green formatting these values.

For example, I'd like to show Web Session (values not displayed as N/A) in green if above 500,000 and Red if below 500,000. Similarly I'd like to show Web Sessions to Initiations  % (values not displayed as N/A) in green if 17% or above and in red if below 17%.

Does this seem possible?

Thank you

@ERing - glad to hear it! 🙂

Sure, here are a couple of options for conditional formatting (PBIX attached):

 

1. Use Conditional Formatting Rules

These rules will automatically not apply to the "N/A" measure values:

OwenAuger_0-1744193563063.pngOwenAuger_1-1744193591540.png

2. Create measure returning the colours:

With this method, it makes more sense to load the Measure/Channel combinations to a physical table (which can also be referenced by the calculation group):

OwenAuger_2-1744193687108.png

Then create these measures to return the colour:

Colour Web Sessions = 
VAR Threshold = 500000
VAR ColourHigh = "#88E769"
VAR ColourLow = "#DA898F"
VAR CurrentChannel = SELECTEDVALUE ( 'Channel Mapping'[Channel] )
VAR HiddenChannels =
    CALCULATETABLE (
        VALUES ( 'Hidden Measure Channel'[Channel] ),
        'Hidden Measure Channel'[Measure] = "Web Sessions"
    )
    
VAR Colour =
    IF (
        NOT CurrentChannel IN HiddenChannels,
        VAR MeasureValue = [Web Sessions]
        RETURN
        SWITCH (
            TRUE (),
            MeasureValue >= Threshold, ColourHigh,
            ColourLow
        )
    )
RETURN
    Colour
Colour Web Sessions to Initiations % = 
VAR Threshold = 0.17
VAR ColourHigh = "#88E769"
VAR ColourLow = "#DA898F"
VAR CurrentChannel = SELECTEDVALUE ( 'Channel Mapping'[Channel] )
VAR HiddenChannels =
    CALCULATETABLE (
        VALUES ( 'Hidden Measure Channel'[Channel] ),
        'Hidden Measure Channel'[Measure] = "Web Sessions to Web Initiations Conversion Baseline"
    )
VAR Colour =
    IF (
        NOT CurrentChannel IN HiddenChannels,
        VAR MeasureValue = [Web Sessions to Web Initiations Conversion Baseline]
        RETURN
        SWITCH (
            TRUE (),
            MeasureValue >= Threshold, ColourHigh,
            ColourLow
        )
    )
RETURN
    Colour

 

OwenAuger_3-1744193797711.png

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

"); $(".slidesjs-pagination" ).prependTo(".pagination_sec"); $(".slidesjs-pagination" ).append("
"); $(".slidesjs-play.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-stop.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-pagination" ).append(""); $(".slidesjs-pagination" ).append(""); } catch(e){ } /* End: This code is added by iTalent as part of iTrack COMPL-455 */ $(".slidesjs-previous.slidesjs-navigation").attr('tabindex', '0'); $(".slidesjs-next.slidesjs-navigation").attr('tabindex', '0'); /* start: This code is added by iTalent as part of iTrack 1859082 */ $('.slidesjs-play.slidesjs-navigation').attr('id','playtitle'); $('.slidesjs-stop.slidesjs-navigation').attr('id','stoptitle'); $('.slidesjs-play.slidesjs-navigation').attr('role','tab'); $('.slidesjs-stop.slidesjs-navigation').attr('role','tab'); $('.slidesjs-play.slidesjs-navigation').attr('aria-describedby','tip1'); $('.slidesjs-stop.slidesjs-navigation').attr('aria-describedby','tip2'); /* End: This code is added by iTalent as part of iTrack 1859082 */ }); $(document).ready(function() { if($("#slides .item").length < 2 ) { /* Fixing Single Slide click issue (commented following code)*/ // $(".item").css("left","0px"); $(".item.slidesjs-slide").attr('style', 'left:0px !important'); $(".slidesjs-stop.slidesjs-navigation").trigger('click'); $(".slidesjs-previous").css("display", "none"); $(".slidesjs-next").css("display", "none"); } var items_length = $(".item.slidesjs-slide").length; $(".slidesjs-pagination-item > button").attr("aria-setsize",items_length); $(".slidesjs-next, .slidesjs-pagination-item button").attr("tabindex","-1"); $(".slidesjs-pagination-item button").attr("role", "tab"); $(".slidesjs-previous").attr("tabindex","-1"); $(".slidesjs-next").attr("aria-hidden","true"); $(".slidesjs-previous").attr("aria-hidden","true"); $(".slidesjs-next").attr("aria-label","Next"); $(".slidesjs-previous").attr("aria-label","Previous"); //$(".slidesjs-stop.slidesjs-navigation").attr("role","button"); //$(".slidesjs-play.slidesjs-navigation").attr("role","button"); $(".slidesjs-pagination").attr("role","tablist").attr("aria-busy","true"); $("li.slidesjs-pagination-item").attr("role","list"); $(".item.slidesjs-slide").attr("tabindex","-1"); $(".item.slidesjs-slide").attr("aria-label","item"); /*$(".slidesjs-stop.slidesjs-navigation").on('click', function() { var itemNumber = parseInt($('.slidesjs-pagination-item > a.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); });*/ $(".slidesjs-stop.slidesjs-navigation, .slidesjs-pagination-item > button").on('click keydown', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); var itemNumber = parseInt($('.slidesjs-pagination-item > button.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); }); $(".slidesjs-play.slidesjs-navigation").on('click', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); }); $(".slidesjs-pagination-item button").keyup(function(e){ var keyCode = e.keyCode || e.which; if (keyCode == 9) { e.preventDefault(); $(".slidesjs-stop.slidesjs-navigation").trigger('click').blur(); $("button.active").focus(); } }); $(".slidesjs-play").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-stop").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-play")) { $(".slidesjs-stop").focus(); } } }); $(".slidesjs-stop").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-play").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-stop")) { $(".slidesjs-play").focus(); } } }); $(".slidesjs-pagination-item").keydown(function(e){ switch (e.which){ case 37: //left arrow key $(".slidesjs-previous.slidesjs-navigation").trigger('click'); e.preventDefault(); break; case 39: //right arrow key $(".slidesjs-next.slidesjs-navigation").trigger('click'); e.preventDefault(); break; default: return; } $(".slidesjs-pagination-item button.active").focus(); }); }); // Start This code is added by iTalent as part of iTrack 1859082 $(document).ready(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); $("#tip2").attr("aria-hidden","true").addClass("hidden"); $(".slidesjs-stop.slidesjs-navigation, .slidesjs-play.slidesjs-navigation").attr('title', ''); $("a#playtitle").focus(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").mouseover(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").blur(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#playtitle").mouseleave(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#play").keydown(function(ev){ if (ev.which ==27) { $("#tip1").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); $("a#stoptitle").focus(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").mouseover(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").blur(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").mouseleave(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").keydown(function(ev){ if (ev.which ==27) { $("#tip2").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); }); // End This code is added by iTalent as part of iTrack 1859082
Top Solution Authors