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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
King8James
Regular Visitor

Dyanmic Sales measure related to selected value from slicer

Hello,

I need a measure that gives the sales of selected scenario and adds preivous sales  i have created the folowing measure

 

New sales =
var forcast = SELECTEDVALUE(scenario[Alternative])
return
CALCULATE( sum(data[Sales]), FILTER(data, data[Alternative]= "FIX" && data[Alternative]= "Forecast")

King8James_0-1660137950616.png

the issue i have is the overlap in month may june and july (it can change depending on the chosen scenario) how can i filter the duplicate value from fix so that i have all values from var 1 or var 2 (selected scenario) and the values that dosent exist from FIX like that 

 

King8James_1-1660138232335.png

here the data source

 

King8James_2-1660138291191.png

 







2 REPLIES 2
Anonymous
Not applicable

Hi @King8James,

You can use switch and selectedvalue function to redirect to different calculation expressions based on current selected value.

My Favorite DAX Feature: SELECTEDVALUE with SWITCH | Winston-Salem Power BI User Group (pbiusergroup...

Regards,

Xiaoxin Sheng

hey thanks for you reply,

 

the issue i have is : i have to include the whole sales of the selected scenario for example if i choose var 1 sales start from may till january 2023 and fix should be the months before may (if  i choose var2  sales start from june 2022 till january 2023 and fix should be the months before june ) so the values of fix are  variable and depend on the chosen scenario.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.