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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
shyamji
Helper I
Helper I

Calendar for future dates

Hi,

i need to display devices count graph for future dates.Suppose i select january 2020 from slicer then need to display graph from feb to july. The code for last 6 months working 

Last6MonthsData =
CALCULATE (
SUM(WarrantyExpiryDevicesQuarterly_Updated[Devices]),
DATESINPERIOD ('Date'[Date], MAX('Date'[Date]), -6, MONTH )
)
in the same way i need DAX query for incoming 6 months.
Thanks
Shyamji
1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @shyamji 

If you original table has data for 2020/2-2020-6, the following measure should work.

 

next6MonthsData = 
CALCULATE (
SUM(WarrantyExpiryDevicesQuarterly_Updated[Devices]),
DATESINPERIOD ('Date'[Date], MAX('Date'[Date]), 6, MONTH )
)

 

If you don't have any data for next 6 months, please tell me the rule to complete this.

For example, i have data for 2019/1~2020/3, then i select 2020/1 from the slicer, want to see the next 6 months' data,

I define the rule is: get the average of the data of 2020/2, 2020/3, then use the average for 2020/4,2020/5,2020/6,2020/7,

the measure is as follows:

average = CALCULATE(AVERAGE('Table'[value]),DATESINPERIOD('date'[Date],MAX('date'[Date]),5,MONTH))

next 6 months = 6*[average]

Capture5.JPG

Best Regards
Maggie
Community Support Team _ Maggie 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

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @shyamji 

Is this problem sloved? 
If it is sloved, could you kindly accept it as a solution to close this case and help the other members find it more quickly?
If not, please feel free to let me know.
 
Best Regards
Maggie
v-juanli-msft
Community Support
Community Support

Hi @shyamji 

If you original table has data for 2020/2-2020-6, the following measure should work.

 

next6MonthsData = 
CALCULATE (
SUM(WarrantyExpiryDevicesQuarterly_Updated[Devices]),
DATESINPERIOD ('Date'[Date], MAX('Date'[Date]), 6, MONTH )
)

 

If you don't have any data for next 6 months, please tell me the rule to complete this.

For example, i have data for 2019/1~2020/3, then i select 2020/1 from the slicer, want to see the next 6 months' data,

I define the rule is: get the average of the data of 2020/2, 2020/3, then use the average for 2020/4,2020/5,2020/6,2020/7,

the measure is as follows:

average = CALCULATE(AVERAGE('Table'[value]),DATESINPERIOD('date'[Date],MAX('date'[Date]),5,MONTH))

next 6 months = 6*[average]

Capture5.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.