Forum Discussion
Switch between two date options based on Filter
- Anonymous4 years ago
Hi Sam7 ,
I updated my sample pbix file(see attachment), please check whether that is what you want.
1. Create a date type dimension table by Enter data method
2. Create a date dimension table and apply the date field on the slicer
Date = CALENDAR(DATE(2022,1,1),DATE(2022,12,31))3. Update the formula of measure [qty] and [ssales]
Best Regards
Hi Sam7 ,
I created a sample pbix file(see attachment) for you, please check whether that is what you want.
1. Create two date dimension table base on the fact table
Note: Do not create any relationship between these two date dimension tables and fact table
2. Apply the date field in above tables on the slicers
3. Create the measures to get the values during the selected date periods
qty =
CALCULATE (
SUM ( 'Table'[quantity] ),
FILTER (
'Table',
IF (
ISFILTERED ( 'Shipped date'[date] ),
'Table'[shipped date] >= MIN ( 'Shipped date'[Date] )
&& 'Table'[shipped date] <= MAX ( 'Shipped date'[Date] ),
1 = 1
)
&& IF (
ISFILTERED ( 'Order date'[Date] ),
'Table'[order date] >= MIN ( 'Order date'[Date] )
&& 'Table'[order date] <= MAX ( 'Order date'[Date] ),
1 = 1
)
)
)
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
- Sam74 years agoAdvocate II
Thanks
How do I build this with an option to choose the date tyoe and only one date slicer?
- Anonymous4 years agoNot applicable
Hi Sam7 ,
I updated my sample pbix file(see attachment), please check whether that is what you want.
1. Create a date type dimension table by Enter data method
2. Create a date dimension table and apply the date field on the slicer
Date = CALENDAR(DATE(2022,1,1),DATE(2022,12,31))3. Update the formula of measure [qty] and [ssales]
Best Regards
- JasonBreedlove2 years agoFrequent Visitor
After much internet sluething, this is the one that finally solved the issue for me. Of course in my use-case, I didn't need to show the summed column so I just put it in a visual filter and said give me rows that are "not blank"