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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
BHarm65
Frequent Visitor

Create measure that only uses year from date slicer

Hi,

 

Can anyone give me a hint how I can create a measure that I can use in a matrix visual that only will respond to the year in the date slicer.

 Case:

I have a matrix that displays the actuals, YTD actuals, Budget and Budget YTD of a selected period (months or quaters)

See example below

BHarm65_0-1700483222494.png

I want to add a measure in the matrix that will dispay the total year budget of the selected year in the period.

I tried to create a measure that only will respond to the year of the selected period.

I created this measure: Total Budget = CALCULATE(SUM(pbi_budgets[Data.pbi_budget]),KEEPFILTERS('Calendar'[Year]))
But it still respond to the quater instead of only the Year

BHarm65_1-1700483705776.png

 

Is there a way to create a measure that only wil respond / calculate based on the year and not the quater.

 

 

 

 

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@BHarm65,

 

Try this measure. It clears filters on the Calendar table, while retaining the Year filter.

 

Total Budget =
CALCULATE (
    SUM ( pbi_budgets[Data.pbi_budget] ),
    ALL ( 'Calendar' ),
    VALUES ( 'Calendar'[Year] )
)

 





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
BHarm65
Frequent Visitor

Thank you very much for the solution.😀

DataInsights
Super User
Super User

@BHarm65,

 

Try this measure. It clears filters on the Calendar table, while retaining the Year filter.

 

Total Budget =
CALCULATE (
    SUM ( pbi_budgets[Data.pbi_budget] ),
    ALL ( 'Calendar' ),
    VALUES ( 'Calendar'[Year] )
)

 





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

Proud to be a Super User!




Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors