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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Benjamin123
New Member

Using Slicers in New Measures

Hi all

 

I have created a variance measure but want one of the variables to be a value from a slicer (multi select) 

 

is this possible? 

1 ACCEPTED SOLUTION

Hi @Benjamin123 ,

 

You will need to create an independent version table as slicer.

Variance = CALCULATE(sum(DataFlip[Value]),filter(DataFlip,DataFlip[Version]in values(slicer[version])))

If I misunderstood your meaning, please show some sample data and expected result.

 

Best Regards,

Jay

 

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Benjamin123 , If you need a measure as slicer, You need create an independent table with all possible values or based on range.

 

find the example of range. In case of each value, you need to have all values and = join with an independent table

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

Hey @amitchandak thanks alot for the reply! 

 

Apologies but I don't think I explained myself very well... I am using the following to create a variance, however I am using a slicer on the report which I would like to overide the latter part of the formula (P8 Latest View)

 

Variance = -CALCULATE(sum(DataFlip[Value]),KEEPFILTERS(DataFlip[Version]="Latest View"))+CALCULATE(sum(DataFlip[Value]),KEEPFILTERS(DataFlip[Version]="P8 Latest View"))
 
The data table used has the following columns in use here: 
- Version ("Latest View")
- Value (Cost)
 
We have multiple versions and a slicer to select which one we want to look at versus the "Latest View". I want variance calculation to be able to use the Slicer value selected ("P8 Latest View" etc.). 
 
Benjamin123_0-1636536942210.png

 

Is there a way to change this part of the formula to select the value from the filter that isnot "Latest View"? 

Hi @Benjamin123 ,

 

You will need to create an independent version table as slicer.

Variance = CALCULATE(sum(DataFlip[Value]),filter(DataFlip,DataFlip[Version]in values(slicer[version])))

If I misunderstood your meaning, please show some sample data and expected result.

 

Best Regards,

Jay

 

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.