Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
ShejalTiwari
Frequent Visitor

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, function, level ,
LOB, country, headcount. Every function have headcount present in different countries. I created two
parameters for country and headcount. I want a functionality by which if I select a country using parameter 1 and headcount
using parameter 2. One extra row of country should be added to each function if already that country is not present and
headcount should be allocated from the parameter 2. For example if I have function as "function1" and headcount is available in
country India, Philippines, USA with headcount as 65,21,20 respectively. If I select China in parameter 1 and select headcount
as 10 in parameter 2 then that function should have 4 countries as India, Philippines, USA,China with headcount as 65,21,20,10 respectively in matrix and China should be added in the columns. So for the given Example with Group CBB, Level A, LOB X, function 1 should add one more country China with headcount 10 using the parameters.

I have attached workbook and data for Your reference.

 

.pbix file attached - https://github.com/Shejalt/Power-BI-files/tree/main

 

@Anonymous 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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

vheqmsft_0-1732071495196.png

 

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

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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

vheqmsft_0-1732071495196.png

 

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

 

Thanks for the solution.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.