Forum Discussion
Dynamically Date Range for Selected Values
- 2 years ago
In visual filter pane, filter Quantity so it doesn't show blank.
Moving forward, it is a good practice to share a sample data (that can be copy pasted to enter data) that best represents your use case rather than a simplified one.
Hi snaseem ,
For this, I'd create a disconnected dates table (no relationship to fact) and a measure that switches between order and shipping date based on a slicer selection. Sample measure
Quantity =
SWITCH (
SELECTEDVALUE ( DateType[DateType] ),
"Order",
CALCULATE (
SUM ( 'Table'[Qty] ),
FILTER ( 'Table', 'Table'[Order Date] IN VALUES ( Dates2[Date] ) )
),
"Shipping",
CALCULATE (
SUM ( 'Table'[Qty] ),
FILTER ( 'Table', 'Table'[Shipping Date] IN VALUES ( Dates2[Date] ) )
)
)
Please see attached sample pbix
- snaseem2 years agoHelper I
danextian thanks, this worked. but I saw problem here. When I filter ship date from 1/06/2023 slicer, the ship date columns reflect date starting from 01/07/2023, I understand there is no data on this date, can it be fixed?
- danextian2 years agoSuper User
Hi. What do you mean by there's no data? This screenshot shows that there is
- snaseem2 years agoHelper I
I have other columns as well to input in the table like amount, cost, shipping amount etc. When I add those details with measure, it does not work. Any idea how to handle this?