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
rufmau68
Helper III
Helper III

Hide categoris values if measures value less then 3

Hi, im new in power bi and i need to produce this result....

 

I have any measure aggregations that in certain scenarios ups to value of 3 (deceases, patients, fragile subjects and go on....)

 

in that case i have not to show that

screenshot_di2121_2025-04-13_17_56_02.png 

but that

screenshot_di2121_2025-04-13_17_56_39.png

if U see, the real category values 60-69 and 70-79 are replaced with an anoymous "N.I." (means Not Identified)

 

And this is just a great challenge form me BUT i have another difficult problem to solve, because in my pbi report i have to activate fields parameter to offer a multi selection feature to user (in categories and also in measures). Because they have to be free to choose what to aggregate in that visual...

 

can anyone helps me ?

thanks at all folks!

 

best regards

Mauro 

17 REPLIES 17
v-kathullac
Community Support
Community Support

Hi @rufmau68  ,

 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.


Regards,

Chaithanya.

sjoerdvn
Super User
Super User

Assumptions: there is a dimension AgeGroup, with a column Name, that includes the "N.I." value and there is a measure [# Deaths]
Based on that we can create this measure:

# Deaths (masked agegroups)=
IF (HASONEFILTER(AgeGroup[Name]),
  IF(VALUES(AgeGroup[Name])="N.I.",
    SUMX(All(AgeGroup[Name]), IF([# Deaths] <=3, [# Deaths])),
    [# Deaths]
  ),
  [# Deaths]
)


i try id, dont works 

 

rufmau68_0-1744798312083.png

 

You will need the "AgeGroup" as a seperate (dimension) table. For a quick fix you can add a Computed table (see example below) and then create a relationship with that fact table, and use the new dimension table column in your visual.

AgeGroups = UNION(SUMMARIZE(Table13,Table13[Fascia_Eta]), {"N.I."})



I created a litte test and I needed to add something to it, to make it work.

# Deaths (masked agegroups) = 
IF (HASONEFILTER(AgeGroup[Fascia_Eta]),
  IF(VALUES(AgeGroup[Fascia_Eta])="N.I.",
    SUMX(All(AgeGroup[Fascia_Eta]), IF([Decessi] <=3, [Decessi])),
     IF([Decessi]>3,[Decessi])
  ),
  [Decessi]
)

sjoerdvn_0-1744803359350.png

 

Hi @rufmau68 ,

 

Can you share the sample pbix file to work around.

 

Regards,

Chaithanya.

Here's my version

 

lbendlin_0-1744985654287.png

 

lbendlin_1-1744985679060.png

 

 

Do you need the totals to work?

yes but U have used a summarizedcolumn() dax function to create a temporary tables to previous evaluate aggregated values... that is a good idea BUT if U have a scenarios where user choose (from a field parameter) what category aggregate... one time anno & fascia_Eta and another time only fascia_Eta, in this 2 cases i have to use 2 different summarizedcolumn() functions.... (alternatively).... there is no any solution where i can define just one (dynamic) summarizedcolum() and use always the same ?

If you check the PBIX you will see that I also added a calculated table.

 

I don't think a dynamic solution is possible at the moment.

 

If this is important to you please consider voting for an existing idea or raising a new one at https://ideas.fabric.microsoft.com

techies
Resolver V
Resolver V

Hi @rufmau68 creating a calculated column might work here

 

Masked AgeGroup =
VAR CurrentAge = 'Deaths'[AgeGroup]
VAR Total =
    CALCULATE(
        sum(deaths[Totale_Decessi]),
        ALLEXCEPT('Deaths', 'Deaths'[Codice_Istat], 'Deaths'[AgeGroup])
    )
RETURN IF(Total <= 3, "N.I.", CurrentAge)

Hi @techies , this solution works but its a static solution.

 

in allexcept() i dont know what column to use because my user select aggregations columns from a field parameter filter , in my sample i use (by exemple) 'Deaths'[Codice_Istat]'Deaths'[AgeGroup] 

but my user can select any other column showed in the fact tables... so i dont know how to configure dinamically allexcept arguments.... 

 

in a below post a data semple with codice_istat, age_group columns but also year column (Anno in italian).

 

if my user from field parameter filter select anno and age group my allexcept have to manage anno and age group

if my user select anno and codice_istat, my allexcept have to manage anno and codice_istat

 

and so on (in the semple i just use 3 columns but, in my real fact table i have many more columns then 3)

 

Hi @rufmau68 ,

 

Thank you for reaching out to Microsoft Fabric Community Forum.

 

You want to mask the AgeGroup field if the total number of deaths is small (e.g., <=3), but the aggregation should respect the columns selected by the user in the report (via a Field Parameter)

Can you try with the below dax it may solve your issue.

 

Masked AgeGroup =
VAR CurrentAge = 'Deaths'[AgeGroup]
VAR IsAnnoSelected = ISINSCOPE('Deaths'[Anno])
VAR IsCodiceIstatSelected = ISINSCOPE('Deaths'[Codice_Istat])
VAR IsAgeGroupSelected = ISINSCOPE('Deaths'[AgeGroup])

VAR Total =
CALCULATE(
SUM('Deaths'[Totale_Decessi]),
REMOVEFILTERS('Deaths'),
KEEPFILTERS(
{
IF(IsAnnoSelected, VALUES('Deaths'[Anno])),
IF(IsCodiceIstatSelected, VALUES('Deaths'[Codice_Istat])),
IF(IsAgeGroupSelected, VALUES('Deaths'[AgeGroup]))
}
)
)

RETURN IF(Total <= 3, "N.I.", CurrentAge)

Regards,

Chaithanya.

thanks, i try it but, dont works... if U are interested I can share U a sample .pbix 

 

bye

mauro 

ThxAlot
Super User
Super User

Congrats! Even though you're a rookie in BPI, this question beats quite many so-called superusers. Now, all you need to do,

1. paste some well-prepared mockup dataset (I don't bother to manully prepare it)

2. wait patiently for nice solutions, if any



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



lbendlin
Super User
Super User

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Thans, here a csv data semple...

AnnoCausa_MorteCodice_IstatFascia_EtaN_Decessi 
4045Causa 111870-54 
6067Causa 1118760-696 
6067Causa 112720-53 
4045Causa 1127260-692 
4045Causa 211870-52 
2023Causa 2118760-691 
6068Causa 212720-55 
2022Causa 2127260-691 
2023Causa 2127270-791 
2023Causa 3118770-791 

Helpful resources

Announcements
Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 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 Kudoed Authors