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
bw70316
Helper V
Helper V

FYTD Daily % Measure Needed -- DAX

what would the DAX equation be to achieve the daily FYTD % numbers. Basically, July 1 = 1/365, July 2= 2/365, etc. So that June 30 = 365/365

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

Hi @bw70316

If you want to calcuate values based on the date in this period: year/7/1~year+1/6/30,

Ashish_Mathur and mattbrice provide good solutions, 

as tested, i use their formula to create two measures:

s1 = CALCULATE(SUM('Data'[value]),DATESYTD('Table'[Date],"6/30"))

s2 = TOTALYTD(SUM('Data'[value]),'Table'[Date],"6/30")

to get the percent as shown, 

please create calcuated columns in the calendar table (called "Table" in my test)

year = YEAR('Table'[Date])

month = MONTH('Table'[Date])

day = DAY('Table'[Date])

total_days =
IF (
    [month] >= 7,
    DATEDIFF ( DATE ( [year], 7, 1 ), DATE ( [year] + 1, 6, 30 ), DAY )
        + 1,
    DATEDIFF ( DATE ( [year] - 1, 7, 1 ), DATE ( [year], 6, 30 ), DAY )
        + 1
)

then create measures:

count_date = CALCULATE(COUNT('Table'[Date]),DATESYTD('Table'[Date],"6/30"))

FYTD % = [count_date]/MAX('Table'[total_days])

FYTD _format = [count_date]&"/"&MAX('Table'[total_days])

14.png

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

v-juanli-msft
Community Support
Community Support

Hi @bw70316

Do these replies help to slove your problem?

If not, please let me know.

 

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

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @bw70316

Do these replies help to slove your problem?

If not, please let me know.

 

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.

v-juanli-msft
Community Support
Community Support

Hi @bw70316

If you want to calcuate values based on the date in this period: year/7/1~year+1/6/30,

Ashish_Mathur and mattbrice provide good solutions, 

as tested, i use their formula to create two measures:

s1 = CALCULATE(SUM('Data'[value]),DATESYTD('Table'[Date],"6/30"))

s2 = TOTALYTD(SUM('Data'[value]),'Table'[Date],"6/30")

to get the percent as shown, 

please create calcuated columns in the calendar table (called "Table" in my test)

year = YEAR('Table'[Date])

month = MONTH('Table'[Date])

day = DAY('Table'[Date])

total_days =
IF (
    [month] >= 7,
    DATEDIFF ( DATE ( [year], 7, 1 ), DATE ( [year] + 1, 6, 30 ), DAY )
        + 1,
    DATEDIFF ( DATE ( [year] - 1, 7, 1 ), DATE ( [year], 6, 30 ), DAY )
        + 1
)

then create measures:

count_date = CALCULATE(COUNT('Table'[Date]),DATESYTD('Table'[Date],"6/30"))

FYTD % = [count_date]/MAX('Table'[total_days])

FYTD _format = [count_date]&"/"&MAX('Table'[total_days])

14.png

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.

Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=CALCULATE(SUM(Data[Value]),DATESYTD(Calendar[Date],"30/6"))

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mattbrice
Solution Sage
Solution Sage

TOTALYTD ( SUM ( Table[Value] ) , DimDate[Date], "06/30" )

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.