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
Sowmiya
Helper III
Helper III

DAX Formula

Hi Community,

How to calculate Half Year to Date and Week to Date from date Field using measure?

 

Thanks in advance,
Sowmiya

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

Hi @Sowmiya

Follow Sowmiya's suggestion, you could use YTD, MTD, QTD,WTD,DTD, Half -Year in the measure to calculate the values.

Addition to that, according to your previous post, what you want is partly achieved in Power BI currently.

 

Per your requirement, the relative date slicer gets us close to this with the “last”, “this”,  “next”, of “Day”, “Week”, “Month” or “Year” settings. That is a dynamic date selection that updates based on the current system date.

Please find more details here.

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

4.png

 

Currently it doesn't support "Quarter" and "Half year", please vote for this idea to improve this feature

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/19321789-dynamic-date-slicer-impr...

 

To workaround this, you could create timeperiod slicer, for example

http://analyticsavenue.com/power-bi-timeperiod-slicer-for-last-7-dayslast-30-days/

 

Best Regards

Maggie

 

 

 

Anonymous
Not applicable

This article might give you some clues of different methods to approach you problem with:

 

https://www.daxpatterns.com/time-patterns/

 

 

For some non-standard period, such as half year, i'd suggest getting this placed into the date table so you can do your half year to date by filtering on these half year markers.  For example inside your date table, you could create a field that uses a simple if statement that says "IF month number <= 6 then the HalfYear is the YEARVALUE concatinated with 1, else the HalfYear is the YEARVALUE concatinated with 2"

 

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.