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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
narchans4u
Frequent Visitor

YTD for multiple measures in matrix

Hi,

 

I am trying to achieve YTD calculation in a matrix (that shows Campaign_name in row and Month-year in column and has multiple values (measures - each one for Paid, one for Active, another for Contacted and so on - each has its calculation in backend - being handled at SQL view level) - as below:

 

 Matrix.PNG

 

MatrixRC.PNG

Now I need to calulate YTD for Paid,Active,Contacted,Quoted(each value) - and show it as column total - shown as below:

 

ExpectedMatrix.PNG 

 

I tried YTD calculation in DAX as follow:

YTDPaid = TOTALYTD(count('Table1'[Paid]),[CreatedDate].[Year])

YTDActive = TOTALYTD(count('Table1'[Active]),[CreatedDate].[Year])

and so on - for each measure - but that doesn't give me expected result of having a YTD calculation on column - for each measure/value. I need one YTD calc for all values - as column total.

 

Any one tried/achieved anything similar to this? Please help

 

 

Regards,

Archana

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi Archana,

 

The TOTALYTD iterates over the dates. So we need feed it with dates rather than years. Please try it like below. The [CreatedDate] should be from the same table with columns of Matrix.

YTDPaid = TOTALYTD(count('Table1'[Paid]),[CreatedDate])


YTDActive = TOTALYTD(count('Table1'[Active]),[CreatedDate])

Best Regards,

Dale

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

Hello,

thanks for your reply.

But with above calculation - I need to write 4+ calculations - one for paid, one active and so on for each status and I will end up placing it in rows - which gives results like this:

image.png

 

Expectation is this:

ExpectedMatrix.PNG

 

Each status which has different calculation i.e. different columns in DB view - Paid,Active,Contacted,Quoted -- set to 1 or 0 and am summing it up in report level) - there's no "status" column as such in DB (should I make one? and bring in data in a different way altogether?)

I want to achieve 1 calc for all the status which changes based on the column/metric (status) in rows

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors