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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
LLT1021
Helper I
Helper I

How to add a measure with user input to rows of your matrix?

Hello all!

I have a matrix and I would like to have a row in this matrix that contains a value based on the user input which is a slicer.
In the slicer you can choose between L03, L06, L09 and budget (text values). Then the row values shoud change dependent on the value chosen, if it's L03 then all rows of the column should contain L03 etc. 
I made a table Planversies with these 4 values and a measure;

 
Planversie = SWITCH (
SELECTEDVALUE ( Planversies[Planversie] ),
"Budget", "Budget",
"LE3", "LE03_Freeze",
"LE6", "LE6",
"LE9", "LE9",
"Onbekende planversie" )

However, it is not possible to put this measure in the rows. What am I doing wrong and does anyone have a solution?
Thanks in advance!
11 REPLIES 11
LLT1021
Helper I
Helper I

Do you have an example maybe?

In my "fact" table...

jgeddes_0-1715002406890.png

Add a column...

ID Category = 
SWITCH(
    TRUE(),
    CONTAINSSTRING([ID], "A"), "Alpha",
    CONTAINSSTRING([ID], "B"), "Bravo",
    "Check ID Validation"
)

Then use that column to create a slicer...

jgeddes_1-1715002463708.png

And use that slicer for user input to filter the fact table...

jgeddes_2-1715002499803.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Thanks a lot! But it different from my case as in my case I am not filtering something. So the calculated column as you defined is not possible in this way.
In my case, if the user says 'A' there should be a A in all the rows, if he gives B it should be B etc. (and this is NOT dependent on anything in your table, its just what the user gives as a text value and it will be in every cell so not filtering). 

Fair enough. If you want to share some examples of what you are expecting as an outcome I, or someone else will have a better idea of the solution you require.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Of course!
So the user can choose one of the following outcomes;

LLT1021_0-1715003420758.png

These values are from a 'Planversies' table which is a disconnected table with only these 4 text values.

Then I have a matrix with lot's of info (I can't share) but its all from a Financial Table.
This table has one row 'Planversie' which should adapt based on the user input, so if someone chooses 'Budget" in every cell should be 'Budget' .This does not filter anything in the table, its just a help for the export of the report later on.
So if you look at your example the original column there should be in all rows of ID an A if you choose A and a B if you choose B. 

I used the following measure:
Planversie = SWITCH (
SELECTEDVALUE ( Planversies[Planversie] ),
"Budget", "Budget",
"LE3", "LE03_Freeze",
"LE6", "LE6",
"LE9", "LE9",
"Onbekende planversie" )

But I can't drop it in the rows of my matrix.

Is this more clear?


I understand now. What you are trying to accomplish cannot be done in DAX. You might be able to come up with a Power Query solution, but it would be quite involved to get it working in the manner you desire. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





LLT1021
Helper I
Helper I

Ah but the thing is you are not filtering anything with it, based on the user input there should be a column that adapts to the user input (but it doesnt filter anything, it contains the value of the user input)

You would have to create a slicer using the created calculated column as in the input.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





LLT1021
Helper I
Helper I

The matrix visual gets data from Fact Financial and the text values are in Planversies (they are disconnected, planversies just contains 4 strings). How do I add a calculated a column based on user input to Planversies table? And in this way its possible to use it in my matrix (which contains values from Fact Financial only?)

If the data you are filtering is in the Fact Financial table then you will need to create the calculated column in that table. 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





jgeddes
Super User
Super User

If it is possible in your data model, you should add your measure as a calculated column to the 'Planversies' table.
 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.