The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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;
Do you have an example maybe?
In my "fact" table...
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...
And use that slicer for user input to filter the fact table...
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.
Proud to be a Super User! | |
Of course!
So the user can choose one of the following outcomes;
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.
Proud to be a Super User! | |
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.
Proud to be a Super User! | |
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.
Proud to be a Super User! | |
If it is possible in your data model, you should add your measure as a calculated column to the 'Planversies' table.
Proud to be a Super User! | |
User | Count |
---|---|
69 | |
67 | |
62 | |
48 | |
28 |
User | Count |
---|---|
112 | |
81 | |
66 | |
54 | |
43 |