Forum Discussion
Switching Date type in a matrix column
I have a dataset with Date Shipped, Date Delivered & Date Paid columns. I want to have a slicer that I can choose which date column to use. The dates have relationships to get the year, period and week number. I have been able to complete what I want by using parameters, but I want the periods to default showing when the selection is made (as shown below), but it collapses to year with the use of a parameter.
Therefore my thought was to create a table with a [Time] column that has Date Paid, Date Shipped & Date Delivered for which to create a slicer that I could then create a measure using SWITCH(SELECTEDVALUE([TIme]),"Paid Date", Paid Date column,"Shipped Date", Shipped Date Column), but I found that I was not able to use the Date in the formula as I thought I would. Any ideas?
2 Replies
- vicky_
Super User
Field parameters might be able to solve part of the issue - https://learn.microsoft.com/en-us/power-bi/create-reports/power-bi-field-parameters
However, you'll need to use some SWITCH statements to select whether to use the Date Shipped, Date Delivered & Date Paid in your DAX calculations. - smwixtedRegular Visitor
Field Parameters works, but collapses the matrix to year, when I want it defaulted to expand 1 level to show period. Is there a way to accomplish without using field parameters?