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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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