Forum Discussion
Dax Measure: Return multiple selected text rows from a single table and column
Hi,
I am new to power BI and DAX and have reviewd many training video's and blogs to find an answer to this however almost all examples relate to calculating sales data within a measure which i am not looking for. Please help....
I have a data set from which i want to create a set of measures that filter my data set, these same measures will be used in a large number of reports in multiple ways.
For this example i have multiple types of Ship/Boats and i want the measure to only return the rows for the values i select.
I have attempted various ways of going about this but have been unsucessful in finding a combination of arguments within Dax Measures.
'Ship Profile'[Ship / Craft Type]
| Fishing |
| Cargo |
| Pleasure Craft |
| Tug |
| Dredger |
| Row Boat |
Please could someone aid me in providing an example of how i can write this up in a DAX measure to return a a result for the items that i have placed in bold and underlined?
Thank you in advance for any guidance you can provide
Best
Chappers
1 Reply
- MFelixSuper User
Hi Chappers ,
Not really sure if I understand you requirement but DAX measures are based in context, meaning that depending on the filters, visuals even the way the measure are written the final result depends on what you give as context.
Looking at your example you can have different ways of setting the context for the measures:
- Add a slicer to your report that has the column and then Select the items in bold
- Add on your visual report or page report the specific column and filter on the bold items
- On the measure itself add a hard coded filter to give you always the same result something like:
-
Measure Filtered = CALCULATE ( [Measure]; FILTER ( ALL ( Table[Column] ); Table[Column] IN { "Cargo"; "Tug"; "Dreger" } ) )
-
Be aware that each of the options as pro and con's and are also depending on the rest of the elements you add to your visuals.
Regards,
MFelix