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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
thx1137
Helper I
Helper I

YTD Quarterly Contribution

Good day,

 

Need to come up with a calculation for a YTD Quarterly Sales Contribution by Quarter.

 

I've accomplished the Quarterly Sales Contribution by Quarter by creating a calculated table, and creating a measure that does a LOOKUPVALUE against that table to get the Sales aggregated to a year, then divides that value by the quarterly value in the main table.

 

Now I want to be able to show the YTD of those quarterly contributions.  For example, if Q1-2020 was 10% and Q2-2020 was 15% and Q3-2020 was 20% the YTD that I want to show in Q1-2020 would be 10%, Q2-2020 would be 25%, and Q3-2020 would be 45%.

 

I have another working YTD type calculation on a different table (with an active relationship to a well-formed Date Table declared as a date table) that looks like this and it works fine (we have a 4/1 fiscal start)

YTD Measure = TOTALYTD(Sales, Dates[Date], "3/31")

 

For this new YTD measure, the table it is based on has an inactive relationship with that same well-formed Date Table, so I have this formula:

 

CALCULATE(

     TOTALYTD(

          Revenue, Dates[Date],"3/31"

     ), USERELATIONSHIP(RevenueTable[Date],Dates[Date])

)

 

...but this calculation returns blank values.  Any thoughts?

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

Hi, @thx1137 

Based on your information, I create a sample table:

vyohuamsft_0-1721616836414.png

Then create a new measure and try the following DAX expression:

YTD_Quarterly_Contribution = 
CALCULATE(
    SUMX(
        FILTER(
            ALL('Table'),
            'Table'[Date] <= MAX('Table'[Date])
        ),
        'Table'[Quarterly Contribution]
    )
)

 

Here is my preview:

vyohuamsft_1-1721616940437.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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
v-yohua-msft
Community Support
Community Support

Hi, @thx1137 

Based on your information, I create a sample table:

vyohuamsft_0-1721616836414.png

Then create a new measure and try the following DAX expression:

YTD_Quarterly_Contribution = 
CALCULATE(
    SUMX(
        FILTER(
            ALL('Table'),
            'Table'[Date] <= MAX('Table'[Date])
        ),
        'Table'[Quarterly Contribution]
    )
)

 

Here is my preview:

vyohuamsft_1-1721616940437.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

Wilson_
Super User
Super User

Can you please share a sample pbix file? (If you don't know how, please check the pinned thread in the forum.) It would make debugging your issue easier. 🙂




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





DataNinja777
Super User
Super User

Hi @thx1137 ,

This may not be the reason of your formula not working, but your formula above is missing square brackets for Revenue measure which I usually expect to see.  

DataNinja777_0-1721441169563.png

Best regards,

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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