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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
inna_sysco
Helper II
Helper II

Select START and END date from the ONE column

Hi, community!
Maybe it's an easy question, but I haven't found a good answer yet...

 
HOW can I select START and an END date (2 separate dropdowns) from the ONE column in the Calendar table? 
And then filter all visuals on the page to show data for this range...

I tried to edit interactions between dropdowns and visuals and I also tried to have 2 separate calendar tables ... and nothing acceptable...

Maybe I did something wrong, so I really need the help of skilled people!
I really appreciate any ideas!

Thanks in advance!
Best wishes, Inna

2 ACCEPTED SOLUTIONS
v-cazheng-msft
Community Support
Community Support

Hi, @inna_sysco 

You can create a Measure like the following to get the result you want.

 

Current Sales =

VAR start_date =

    CALCULATE ( MIN ( Calendar_start[Date] ), ALLSELECTED ( Calendar_start[Date] ) )

VAR end_date =

    CALCULATE ( MAX ( Calendar_end[Date] ), ALLSELECTED ( Calendar_end[Date] ) )

RETURN

    CALCULATE (

        SUM ( 'Table'[VALUE] ),

        'Table'[DAYTIME] >= start_date

            && 'Table'[DAYTIME] <= end_date

)

 

The result looks like this:

v-cazheng-msft_0-1615449647050.png

Here is the pbix.

 

Best Regards,

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

Hi, @inna_sysco 

You can create a Calculated column and use it as the X axis of the visual.

 

Format DAYTIME = FORMAT(Table_test[DAYTIME],"mmm")&" "&YEAR(Table_test[DAYTIME])

 

The result looks like this:

v-cazheng-msft_0-1615529473388.png

 

Here is the pbix.

 

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

6 REPLIES 6
v-cazheng-msft
Community Support
Community Support

Hi, @inna_sysco 

You can create a Measure like the following to get the result you want.

 

Current Sales =

VAR start_date =

    CALCULATE ( MIN ( Calendar_start[Date] ), ALLSELECTED ( Calendar_start[Date] ) )

VAR end_date =

    CALCULATE ( MAX ( Calendar_end[Date] ), ALLSELECTED ( Calendar_end[Date] ) )

RETURN

    CALCULATE (

        SUM ( 'Table'[VALUE] ),

        'Table'[DAYTIME] >= start_date

            && 'Table'[DAYTIME] <= end_date

)

 

The result looks like this:

v-cazheng-msft_0-1615449647050.png

Here is the pbix.

 

Best Regards,

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi @v-cazheng-msft !
Thank you so much for the detailed explanation! 
Your solution works great when I need to display the total on the card visual, but when I need to also manage the timeline it doesn't work...
image.png
Could you help me with that?
I am attaching the file where I tried to apply your solution.


Hi, @inna_sysco 

You can create a Calculated column and use it as the X axis of the visual.

 

Format DAYTIME = FORMAT(Table_test[DAYTIME],"mmm")&" "&YEAR(Table_test[DAYTIME])

 

The result looks like this:

v-cazheng-msft_0-1615529473388.png

 

Here is the pbix.

 

Best Regards

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you, @v-cazheng-msft !
This works perfectly!
I very much appreciate your help!

amitchandak
Super User
Super User

@inna_sysco , For that you need two independent date tables.

Refer to my blog, where we have two ranges. In place of that, you can have two list and select dates, and use them in the same measure

 

https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

 

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak , thanks for your answer!
I tried to implement the solution presented in your article, but it doesn't work for me...
I used your measure to calculate sum:

Current Sales = (
VAR _Cuur_start = Min(‘Date’[Date Filer])
VAR _Curr_END = Max(‘Date’[Date Filer])
return
calculate(sum(Sales[Sales Amount]),Sales[Sales Date] >= _Cuur_start && Sales[Sales Date] <= _Curr_END ))

But in my case, using SELECTEDVALUEs from 2 different slicers:

Current Sales = (
VAR _Cuur_start = SELECTEDVALUE('Calendar_start'[Date])
VAR _Curr_END = SELECTEDVALUE('Calendar_end'[Date])
    return
calculate(sum(Table[VALUE]), Table[DAYTIME] >= _Cuur_start && Table[DAYTIME] <= _Curr_END ))

Maybe I did something wrong?

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors