Forum Discussion

rufmau68's avatar
rufmau68
Icon for Helper III rankHelper III
1 year ago
Solved

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

 

but that

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 

  • Hi @rufmau68  ,

     

    We wanted to kindly follow up to check if the solution for the issue worked. If not, please let us know if you need further assistance. If none of the provided solutions worked, kindly share the original solution so that other community members can benefit from it in case they face a similar issue.

    If our response addressed your concern, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

     

    Regards,
    Chaithanya.

20 Replies

  • 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-Forum/ba-p/963216
    Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

    • rufmau68's avatar
      rufmau68
      Icon for Helper III rankHelper III

      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 
  • 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

  • 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)
    • rufmau68's avatar
      rufmau68
      Icon for Helper III rankHelper III

      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)

       

      • v-kathullac's avatar
        v-kathullac
        Icon for Community Support rankCommunity Support

        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.

  • sjoerdvn's avatar
    sjoerdvn
    Icon for Solution Sage rankSolution Sage

    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]
    )
    
    
    
      • sjoerdvn's avatar
        sjoerdvn
        Icon for Solution Sage rankSolution Sage

        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."})



  • v-kathullac's avatar
    v-kathullac
    Icon for Community Support rankCommunity 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.

      • v-kathullac's avatar
        v-kathullac
        Icon for Community Support rankCommunity Support

        Hi @rufmau68  ,

         

        We wanted to kindly follow up to check if the solution for the issue worked. If not, please let us know if you need further assistance. If none of the provided solutions worked, kindly share the original solution so that other community members can benefit from it in case they face a similar issue.

        If our response addressed your concern, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

         

        Regards,
        Chaithanya.

  • v-kathullac's avatar
    v-kathullac
    Icon for Community Support rankCommunity Support

    Hi @rufmau68  ,

     

    We wanted to kindly follow up to check if the solution for the issue worked. If not, please let us know if you need further assistance. If none of the provided solutions worked, kindly share the original solution so that other community members can benefit from it in case they face a similar issue.

    If our response addressed your concern, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

     

    Regards,
    Chaithanya.