Forum Discussion
ninja18
Helper I
9 months agoFlip columns values (strings - dimensions/rows (Rows section in matrix)) based on parameter
I want to flip the column values based on parameter selection. For example I have two columns First Name and Last Name. Parameter Values --> First, Last Last, First First, Last Option: Fir...
- 9 months ago
Add extra rows to your field paramter table and another column to group the rows into
NamesParameter = { ( "FirstName", NAMEOF ( 'Names'[FirstName] ), 0, "First, Last" ), ( "LastName", NAMEOF ( 'Names'[LastName] ), 1, "First, Last" ), ( "FirstName", NAMEOF ( 'Names'[FirstName] ), 3, "Last, First" ), ( "LastName", NAMEOF ( 'Names'[LastName] ), 2, "Last, First" ) }The order column determines their display order.
Shubham_rai955
Super User
9 months agoUse a field parameter (or a simple DAX column if you only need a concatenated full name).
Option 1 – concatenated column (easiest)
Create a column in your dimension table:
Full Name := VAR FirstLast = 'DimPeople'[First Name] & " " & 'DimPeople'[Last Name] VAR LastFirst = 'DimPeople'[Last Name] & " " & 'DimPeople'[First Name] RETURN SWITCH ( SELECTEDVALUE ( 'Name Order Parm'[Order] ), "First, Last", FirstLast, "Last, First", LastFirst, FirstLast )
Name Order Parm is a disconnected table with values "First, Last" and "Last, First" used as a slicer.
Use Full Name on Rows of your matrix; changing the slicer flips the order.
Option 2 – field parameter for separate columns
If you truly need two separate columns, create a field parameter containing [First Name] and [Last Name], then duplicate it and use techniques for dynamic hierarchies so the parameter’s order depends on a small “Order” table controlled by a slicer.
ninja18
Helper I
9 months agoThank you, Shubham !
Can you eloborate the option 2 please?