Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
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?
Solved! Go to Solution.
Hi, @thx1137
Based on your information, I create a sample table:
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:
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.
Hi, @thx1137
Based on your information, I create a sample table:
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:
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.
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. 🙂
Proud to be a 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.
Best regards,
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
87 | |
65 | |
50 | |
45 |
User | Count |
---|---|
217 | |
88 | |
81 | |
65 | |
56 |