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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
cgriffin
New Member

Beginning of year measure value is a constant throughout year

I am working on a dashboard that shows our annual rate of follower growth on a daily level. I have calculated the measure for our followers total at the beginning of the year using the following formula.

Followers/Subscribers - Year Start = CALCULATE(SUM('Organic Social - NonAggregate Reach & Followers'[FollowersSubscribers]),'Date Table'[IsStartOfYear] = TRUE())

Where [IsStartOfYear] is referencing a Date table and using this formula:

IsStartOfYear = IF(AND('Date Table'[Date].[Date] = 'Date Table'[Start of Quarter].[Date],'Date Table'[Quarter Number] = 1),TRUE(),FALSE())

 

From there, I assumed I could calculate the YTD growth using this simple formula

Followers/Subscribers - Growth YTD = [Followers/Subscribers] - [Followers/Subscribers - Year Start]

 

The issue is that the "Year Start" value only applies for the first day of the year, and not the remaining days of the year. See table below:

cgriffin_0-1715786292432.png

 

Is there a way I can make this Year Start value a constant throughout the entire year? In this case, Year Start would be 232,729 for every day throughout the year. Ideally this would be based on what year I have selected from a Year slicer.

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

Hi @cgriffin 

 

Thanks for the reply from @amitchandak , please allow me to provide another insight:
Please change the [Followers/Subscribers - Year Start] :

Followers/Subscribers - Year Start =
VAR _SOY =
    STARTOFYEAR ( 'Date Table'[Date] )
RETURN
    CALCULATE (
        SUM ( 'Organic Social - NonAggregate Reach & Followers'[FollowersSubscribers] ),
        FILTER ( ALLSELECTED ( 'Date Table' ), 'Date Table'[IsStartOfYear] = _SOY )
    )

Here I create a set of sample for your reference:

vzhengdxumsft_0-1715840762437.png

Then add a measure:

MEASURE =
VAR _SOY =
    STARTOFYEAR ( 'Table'[Date] )
RETURN
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] = _SOY )
    )

The result is as follow:

vzhengdxumsft_1-1715840867475.png

 

Best Regards

Zhengdong Xu
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
cgriffin
New Member

I used your first formula with one minor tweak, and that worked perfectly!

 

My date table actually didn't didnt have a Start of Year dimensions, so I had to add that first. I used this as my solution:

 

Followers/Subscribers - Year Start (REDO) = 
VAR _SOY =
    STARTOFYEAR ( 'Date Table'[Date] )
RETURN
    CALCULATE (
        SUM ( 'Organic Social - NonAggregate Reach & Followers'[FollowersSubscribers] ),
        FILTER ( ALLSELECTED ( 'Date Table' ), 'Date Table'[Date].[Date] = _SOY )
    )
v-zhengdxu-msft
Community Support
Community Support

Hi @cgriffin 

 

Thanks for the reply from @amitchandak , please allow me to provide another insight:
Please change the [Followers/Subscribers - Year Start] :

Followers/Subscribers - Year Start =
VAR _SOY =
    STARTOFYEAR ( 'Date Table'[Date] )
RETURN
    CALCULATE (
        SUM ( 'Organic Social - NonAggregate Reach & Followers'[FollowersSubscribers] ),
        FILTER ( ALLSELECTED ( 'Date Table' ), 'Date Table'[IsStartOfYear] = _SOY )
    )

Here I create a set of sample for your reference:

vzhengdxumsft_0-1715840762437.png

Then add a measure:

MEASURE =
VAR _SOY =
    STARTOFYEAR ( 'Table'[Date] )
RETURN
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Date] = _SOY )
    )

The result is as follow:

vzhengdxumsft_1-1715840867475.png

 

Best Regards

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

 

amitchandak
Super User
Super User

@cgriffin , try measures like

 

Start of year =
var _max = max('Date'[Date]
return
calculate([Followers/Subscribers] , 'Date'[Date] = ( eomonth(_max , -1* month(_max)) +1 ))

Or

Start of year =
var _max = max('Date'[Date]
return
calculate([Followers/Subscribers] , filter(all('Date') , 'Date'[Date] = ( eomonth(_max , -1* month(_max)) +1 )))

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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