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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
johntakeda
New Member

Always display year end target regardless of month selected

Hi there,

 

Looking for some help.  I'm trying to manipulate a matrix so that whichever month I have selected with my slicer, it will always show the final "year end Budget", similar to the below:

 

johntakeda_1-1652902326422.png

 

My year end is March (financial year).

 

The format of my input data is an excel table like the below:

 

johntakeda_2-1652902587443.png

 

When i load this data I transform and unpivot the date columns, so i'm left with just the one Budget column by cost center and date.

 

I suppose I could just create another excel file, where every month's data is the year end number, but I think there must be a more elegant way to do this.  Maybe some sort of measure that says IF the month is anything other than march, make it march...but i've no clue how this would look.

 

Any help is much appreciated.

 

Thanks,

 

John

 

 

 

 

1 ACCEPTED SOLUTION

Hi @johntakeda ,

A calculated column can work fine in the total.

Year end budget =
DIVIDE (
    SUMX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Date] = DATE ( 2023, 3, 1 )
                && 'Table'[Cost center] = EARLIER ( 'Table'[Cost center] )
        ),
        'Table'[Budget]
    ),
    COUNTROWS (
        FILTER (
            'Table',
            'Table'[Cost center] = EARLIER ( 'Table'[Cost center] )
                && 'Table'[Date] = EARLIER ( 'Table'[Date] )
        )
    )
)

Get the correct result.

vkalyjmsft_0-1654053099316.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

6 REPLIES 6
v-yanjiang-msft
Community Support
Community Support

Hi @johntakeda ,

According to your description, I create a sample, and after unpivoting as you described, get this table.

vkalyjmsft_0-1653464784308.png

Here's my solution, create a measure.

Year end budget =
SUMX (
    FILTER (
        ALL ( 'Table' ),
        'Table'[Date] = DATE ( 2023, 3, 1 )
            && 'Table'[Cost center] = MAX ( 'Table'[Cost center] )
    ),
    'Table'[Budget]
)

Get the correct result.

vkalyjmsft_1-1653464933606.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

This is really excellent, I had to add an extra line because I oversimplified in my original post, and there is an extra piece of data in there on whether the FTE are Own or Leased:

 

johntakeda_0-1653487933919.png

I just have one follow up, it gives a very strange result in the "total" for all Cost centres:

 

johntakeda_1-1653488152278.png

 

It seems like it just took the cost center with the largest number instead of the sum...any idea how to fix this?

 

Thanks,

 

John

Hi @johntakeda ,

A calculated column can work fine in the total.

Year end budget =
DIVIDE (
    SUMX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Date] = DATE ( 2023, 3, 1 )
                && 'Table'[Cost center] = EARLIER ( 'Table'[Cost center] )
        ),
        'Table'[Budget]
    ),
    COUNTROWS (
        FILTER (
            'Table',
            'Table'[Cost center] = EARLIER ( 'Table'[Cost center] )
                && 'Table'[Date] = EARLIER ( 'Table'[Date] )
        )
    )
)

Get the correct result.

vkalyjmsft_0-1654053099316.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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

 

 

Fantastic - thanks for your help!

amitchandak
Super User
Super User

@johntakeda , refer if the use CLOSINGBALANCEYEAR  in this blog can help

Distributing/Allocating the Yearly Target(Convert to Daily Target): Measure ( Daily/YTD): Magic of CLOSINGBALANCEYEAR With TOTALYTD/DATESYTD: https://community.powerbi.com/t5/Community-Blog/Power-BI-Distributing-Allocating-the-Yearly-Target-C...

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi amitchandak,

 

The post is interesting, but not really relevant to my question.

 

I think I need some kind of measure that would return the data for the final month of the year regardless of which month i'm looking at, but I can't think how to build it.

 

Thanks,

 

John

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.