Forum Discussion

ShejalTiwari's avatar
ShejalTiwari
Frequent Visitor
1 year ago
Solved

Add datarows using parameters in Power BI

Can you please help me with below problem? I have group, function, level , LOB, country ,headcount and few more columns in my data putup in a matrix as shown. Currently making use of only group, fu...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi ShejalTiwari ,
    According to your description, adding a column to an already fixed matrix is not supported in power bi. If you want to add a new column it is equivalent to adding several rows to the data, which is not possible with data that is already fixed. But there is a way you can try it. You can create a new matrix and display the measure separately.

    SelectedCountry = 
    VAR _SelectedCountry = SELECTEDVALUE('Select Country 1'[Country])
    VAR _CurrentCountryList = VALUES(Sheet1[Country])
    VAR _isAdded = 
    IF(
        _SelectedCountry IN _CurrentCountryList,
        0,
        SELECTEDVALUE('HC % Change 1'[Headcount % Change 1])
    )
    RETURN
    _isAdded
    Sum of head count = SUM(Sheet1[Headcount])
    Total = [SelectedCountry] + [Sum of head count]

    Final output

     

    Best regards,
    Albert He


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