Forum Discussion

Nabil20_24's avatar
Nabil20_24
Helper I
1 year ago
Solved

Island Table

Hi All, 

 

I have the table below as well as other tables, the relationship between this table and the other tables is 1 to *; I created calculated coulmn in the below table and called maskedcountryname which shows Country 1 to 4 and then I created an island table which contains one column and two rows masked / unmasked. so what I am trying to do is that create a table visual which show either the name of the country or just the masked name as well as some columns pulled from the below table, measures created, and other columns from different table;  
this is my code but its not woking as when I change the option from the slicer the name of the country does not change 

MaskTable = DATATABLE(
    "Mask", STRING,
    {
        {"Masked"},
        {"Unmasked"}
    }
)
DisplayedName =
IF(
    SELECTEDVALUE(MaskTable[Mask], "Masked") = "Unmasked",
    'Data '[Country Name ],
    'Data '[MaskedName]
)


anyone cna tell me why this is not working the slicer seems to return what has been selected but the table I created does not change at all.

Country Name Total Sales Forecasted Revenue Budget 
England 10010005000500
France 20035003400600
Germany 30044001200800
Spain 40076006230900



  • Hi Nabil20_24 

     

    I just created a DisplayedName measure instead of a calculated column and it worked perfectly.

     

     

    I've also attached a link to a reference file. You can check it out as well.

     

    File


    Best Regards,
    Muhammad Yousaf

     

    If this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly.

     

    LinkedIn

     

3 Replies

  • muhammad_786_1's avatar
    muhammad_786_1
    Solution Supplier

    Hi Nabil20_24 

     

    I just created a DisplayedName measure instead of a calculated column and it worked perfectly.

     

     

    I've also attached a link to a reference file. You can check it out as well.

     

    File


    Best Regards,
    Muhammad Yousaf

     

    If this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly.

     

    LinkedIn

     

  • Hello Nabil20_24,

     

    Can you please try this revised version:

    DisplayedName = 
    IF(
        SELECTEDVALUE(MaskTable[Mask], "Masked") = "Unmasked",
        MAX('Data'[Country Name]),
        MAX('Data'[MaskedName])
    )
    
    • Nabil20_24's avatar
      Nabil20_24
      Helper I

      Hi Sahir, 

       

      Thanks for this. Actually max will return one row only