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
prv_1401
Helper I
Helper I

Dax measure to show the next 7days value of a selected date

Hi guys !

I am very new to PowerBI and it's just been two weeks in learning the tool .

 

Could you suggest me the Dax measure, functions, syntax or any idea of resolving this requirement ? 

Basically the requirement is I have to create an area chart which shows the trend . And when I select a particular date in the slicer it has to filter the Visual and show the next 7days value in the visual . 

 

Kindly pour in your thoughts and ideas . Any advise or suggestions and motivations as I am new to PowerBI and DAX would be really appreciated. Thank you all ♥️

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @prv_1401 ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1662428794396.png

Please try:

FIrst, create a Date table

vjianbolimsft_1-1662428837135.png

Then build relationship between the two tables

vjianbolimsft_2-1662428899505.png

Then create a new table for slicer(this table does not have any relationship between other tables)

vjianbolimsft_3-1662428971595.png

Apply it to the slicer and turn on single select of the slicer

vjianbolimsft_4-1662429407073.png

 

Then create a measure and apply it to the visual

Measure =
VAR _a =
    SELECTEDVALUE ( 'For Slicer'[Date] )
RETURN
    CALCULATE (
        MAX ( 'Table'[Value] ),
        FILTER ( 'Table', [Date] >= _a && [Date] <= _a + 7 )
    )

vjianbolimsft_5-1662429499361.png

Final output:

vjianbolimsft_6-1662429537330.png

vjianbolimsft_7-1662429558703.png

Best Regards,

Jianbo Li

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

3 REPLIES 3
v-jianboli-msft
Community Support
Community Support

Hi @prv_1401 

 

Please try:

Measure = 
VAR _a =
    SELECTEDVALUE ( 'For Slicer'[Date] )
RETURN
    CALCULATE (
        MAX ( 'Table'[Value] ),
        FILTER ( 'Table', [Date] > _a && [Date] < _a + 7 )
    )

Final output:

vjianbolimsft_0-1662448666990.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

v-jianboli-msft
Community Support
Community Support

Hi @prv_1401 ,

 

Based on your description, I have created a simple sample:

vjianbolimsft_0-1662428794396.png

Please try:

FIrst, create a Date table

vjianbolimsft_1-1662428837135.png

Then build relationship between the two tables

vjianbolimsft_2-1662428899505.png

Then create a new table for slicer(this table does not have any relationship between other tables)

vjianbolimsft_3-1662428971595.png

Apply it to the slicer and turn on single select of the slicer

vjianbolimsft_4-1662429407073.png

 

Then create a measure and apply it to the visual

Measure =
VAR _a =
    SELECTEDVALUE ( 'For Slicer'[Date] )
RETURN
    CALCULATE (
        MAX ( 'Table'[Value] ),
        FILTER ( 'Table', [Date] >= _a && [Date] <= _a + 7 )
    )

vjianbolimsft_5-1662429499361.png

Final output:

vjianbolimsft_6-1662429537330.png

vjianbolimsft_7-1662429558703.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey Thank you so much for the reply. It does work .
However I dont want the selected date value to be shown in the visual . Only the next 7 days of the selected date want to be shown. From the above sample If I select 1-6-22 , the chart should show the values of date 7,8,9,10,11,12 .

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.