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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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