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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
joschultz
Advocate II
Advocate II

Change measure based on slicer

 

 

I have two tables.  The first one is Actual sales.

 

DateClientScenarioMetricData
5/1/2017AActualGross Sales500
5/2/2017AActualGross Sales500
5/3/2017AActualGross Sales500
5/4/2017AActualGross Sales500
5/5/2017AActualGross Sales500

 

The second is a forecast table

DateClientScenarioMetricData
5/1/2017APlannedGross Sales1000
5/2/2017APlannedGross Sales1000
5/3/2017APlannedGross Sales1000
5/4/2017APlannedGross Sales1000
5/5/2017APlannedGross Sales1000
5/1/2017ACurrent ForecastGross Sales900
5/2/2017ACurrent ForecastGross Sales900
5/3/2017ACurrent ForecastGross Sales900
5/4/2017ACurrent ForecastGross Sales900
5/5/2017ACurrent ForecastGross Sales900

 

In the second table there are two types of forecasts.  One is Planned and the other is Current Forecast.  I have measures created for all three.  However I want to be able to have a slicer on my reports that lets me change my calcuations based on Planned and Current Forecast.  For instance I want my MTD variance to be  [Total Actual] - [Total Planned or Current Forecast} based on which one I have selected. 

 

Any ideas on the best way to do this?

 

Thank you,

 

Joseph

1 REPLY 1
v-jiascu-msft
Microsoft Employee
Microsoft Employee

@joschultz

 

Hi Joseph,

 

First, we need a Date table and then establish relationships with ActualSales and ForcastSales. This can ensure we evaluate the MTD in the same time period. We can create a Date table with this formula.

Date =
CALENDAR ( DATE ( 2017, 1, 1 ), DATE ( 2017, 12, 31 ) )

Actually, we just need one measure. But we create three to see the steps.

TotalActual =
TOTALMTD ( SUM ( ActualSales[Data] ), 'Date'[Date] )
TotalForcast =
TOTALMTD ( SUM ( ForecastSales[Data] ), 'Date'[Date] )
Result =
TOTALMTD ( SUM ( ActualSales[Data] ), 'Date'[Date] )
    - TOTALMTD ( SUM ( ForecastSales[Data] ), 'Date'[Date] )

or

Result =
[TotalActual] - [TotalForcast]

Finally we can create a slicer with ForcastSales[scenario]. And a slicer with 'Date'[date] if needed.Change measure based on slicer1.jpgChange measure based on slicer2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors