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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
JavierGold
Regular Visitor

Displaying a measure total that ignores date slicer

I'm trying to use a measure to calc a total budget for the year to use in a gauge.   my formula is:

 

BudgetTotal = CALCULATE(sum('2017FinancialData'[Total]),'2017FinancialData'[type] = "Budget",All('2017FinancialData'[Total]))

 

I have a date slicer on the report that allows a user to select a date range...however, it is converting the measure to a YTD value instead of a Total for the Year.   How do I have this measure ignore the date slicer that I have on the report?

 

Thanks!

Jeff

1 ACCEPTED SOLUTION
Anonymous
Not applicable

It's just general "best practices" to have a separate calendar table, and power bi helps you via CALENDARAUTO( ) function if you don't have one easily.  The idea is that you want a calendar w/ no "gaps" (missing days) ... and also fewer rows than would typically be in your large fact table.

 

Ignoring that if you want...  I would expect something more like:

 

BudgetTotal = CALCULATE(sum('2017FinancialData'[Total]),'2017FinancialData'[type] = "Budget",All('2017FinancialData'[DateField]))

 

But you need to keep it in the same year, so you would need a year column in your table and add it to your All as AllExcept or add another param to calculate that is VALUES(MyTable[Year]).

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Typically, you would have a separate data/calendar table, and that is where the slicer would come from... AND... where the dax measure should filter.

 

Your final ALL( ) looks a bit weird to me, I would expect something clearing some date fields instead.

Yeah...the All() was just an attempt to get the total.  

 

The data table has both budget and actual rows that includes a column for the date that each row is for.   I'm don't see how I could separate the date from that table?

Anonymous
Not applicable

It's just general "best practices" to have a separate calendar table, and power bi helps you via CALENDARAUTO( ) function if you don't have one easily.  The idea is that you want a calendar w/ no "gaps" (missing days) ... and also fewer rows than would typically be in your large fact table.

 

Ignoring that if you want...  I would expect something more like:

 

BudgetTotal = CALCULATE(sum('2017FinancialData'[Total]),'2017FinancialData'[type] = "Budget",All('2017FinancialData'[DateField]))

 

But you need to keep it in the same year, so you would need a year column in your table and add it to your All as AllExcept or add another param to calculate that is VALUES(MyTable[Year]).

Thank you!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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