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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

Add YTD to matrix visual for Power BI desktop report

I have a matrix in a power bi desktop report in which I would like to add the YTD and baseline goals for different metrics(some are percentage values, others are float). In the rows field, I have the metrics, in the columns I have actuals and targets for different quarters(Q1 Actuals, Q1 targets), and in the values field, I have the values for the metrics.

After I created a YTD measure and added it to the values field in the matrix, it shows the YTD calculations for all the quarter actuals/targets(Q1 Actuals and Q2 Actuals). I want the YTD calculation to show as the last column in the matrix and not for each quarter. I would also like to add a baseline goal(it will be a measure) as the first column in the matrix.

1 ACCEPTED SOLUTION

 Hi @Anonymous 

 

In response to your question, I have created the following table

 

vjialongymsft_0-1704424037434.png

 

 

For the issue you mentioned that YTD is more than 100%, I updated my formula

 

YTDD = IF(

    ISINSCOPE('Table'[date].[Quarter]),

    BLANK(),

    TOTALYTD(DIVIDE(SUM('Table'[Actual Goal]),SUM('Table'[Target Goal]),BLANK()), 'Table'[date])

)

 

vjialongymsft_1-1704424037437.png

 

 

 

For issues where you only want to show YTD in the last column, this is a by design issue for power bi.

 

 

 

 

Best Regards,

Jayleny

 

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

5 REPLIES 5
v-jialongy-msft
Community Support
Community Support

 Hi @Anonymous 

 

 

If you simply use the YTD function as follows, it will be displayed at the end of each quarter.

vjialongymsft_0-1704346704241.png

 

 

If you use the following DAX, it will only be displayed at the end

 

YTD Measure without quarter = IF(

    ISINSCOPE('Table'[date].[Quarter]),

    BLANK(),

    TOTALYTD(SUM('Table'[value]), 'Table'[date])

)

 

vjialongymsft_1-1704346704242.png

 

 

 

You also want to add a baseline goal as the first column in the matrix

Since you have not provided your specific data, I can only provide you with DAX that may implement your needs

 

 

Baseline Goal Measure = CALCULATE(SUM('YourTable'[YourGoalColumn]), 'YourTable'[MetricType] = "Baseline")

 

 

If you need further help, please provide your sample data

 

 

 

 

Best Regards,

Jayleny

 

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

Anonymous
Not applicable

Hi @v-jialongy-msft , thanks for your help. I tried this and it's nearly working. In my matrix table, the YTD measure keeps showing up for every quarter but I would only like this to show up as the last column in the matrix and the subtotal for the YTD in the last column is over 100%, which needs to be corrected

Here's an example of my matrix:
As you can see below, the YTD measure keeps showing up very every quarter in the columns which I need to get rid of. Also, the subtotal for the YTD in the last column is over 100%, which needs to be corrected. matrix.PNG
I would appreciate any help, thanks.

 Hi @Anonymous 

 

In response to your question, I have created the following table

 

vjialongymsft_0-1704424037434.png

 

 

For the issue you mentioned that YTD is more than 100%, I updated my formula

 

YTDD = IF(

    ISINSCOPE('Table'[date].[Quarter]),

    BLANK(),

    TOTALYTD(DIVIDE(SUM('Table'[Actual Goal]),SUM('Table'[Target Goal]),BLANK()), 'Table'[date])

)

 

vjialongymsft_1-1704424037437.png

 

 

 

For issues where you only want to show YTD in the last column, this is a by design issue for power bi.

 

 

 

 

Best Regards,

Jayleny

 

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

 

 

audreygerred
Super User
Super User

Hi! Sounds like you have your subtotals on for columns. If you don't want the YTD amount to show after each quarter, try adjusting the subtotals showing from the editing pane for that visual.





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

Proud to be a Super User!





Anonymous
Not applicable

Hi @audreygerred, thanks for your help. I tried this and it's not working because the column subtotals are counting the columns with the quarter targets, in addition to the quarter actuals. 

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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