Forum Discussion

Bartwelvaarts's avatar
Bartwelvaarts
Regular Visitor
2 years ago
Solved

Create overarching level

Hi community,   I have a table with a field named level2. I have a couple dimension values over here. Then I quite a lot of other measure fields. I want to create a level 1 based on the values of l...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, Bartwelvaarts 

    Thanks for the reply from amitchandak, please allow me to provide another insight:

    You'll need to create a new calculated column in Power BI Desktop that evaluates the values in the field and assigns a new overall name accordingly. You can use DAX or a function to check the value and assign a new name.

    For example, use the following function:

     

    Overarching_Level = SWITCH(
        TRUE(),
        'YourTable'[level2] IN {"rowname1", "rowname2", "rowname3"}, "Overarching_name1",
        'YourTable'[level2] IN {"rowname1", "rowname2", "rowname3", "rowname4"}, "Overarching_name2",
        'YourTable'[level2]
    )

     


    This DAX formula checks the value of and assigns it to a new overall name based on the criteria you specify. If none of the conditions are met, only the original value is returned.

    Use new columns in a pivot table: Once you have a new column, you can use it as a dimension in a pivot table. This will allow you to group the data by population name and calculate the subtotals for each group.

     

    How to Get Your Question Answered Quickly 

    Best Regards

    Yongkang Hua

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