Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
snaseem
Helper I
Helper I

Dynamically Date Range for Selected Values

Hi,

I want to display the data according to the selected values from Date Type, then accordingly the Date slicer filters the data in the table. If a user selects order date, then the date range selection should filter the table for order date.

snaseem_0-1693003030043.png

 

Thanks,

1 ACCEPTED SOLUTION

In visual filter pane, filter Quantity so it doesn't show blank.

danextian_0-1693188255986.png

danextian_1-1693188264095.png

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.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

6 REPLIES 6
Ashish_Mathur
Super User
Super User

Hi,

Share the download linnk of the PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
danextian
Super User
Super User

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] ) )
        )
)

 

danextian_0-1693017534561.png

danextian_1-1693017548020.png

Please see attached sample pbix





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

@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?

Hi. What do you mean by there's no data? This screenshot shows that there is

danextian_0-1693051307200.png

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

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?

In visual filter pane, filter Quantity so it doesn't show blank.

danextian_0-1693188255986.png

danextian_1-1693188264095.png

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.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.