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
jondurbridge
Helper I
Helper I

Apply A Slicer Directly To A Measure

Hello

 

I would like to know if I can apply a slicer directly to a measure?

I have 2 slicers which apply to a whole report, and I have 2 measures in a line graph. But I do not want the slicers to affect the other measure, and to have both lines plotted on the same graph.

 

I have a date opened, and a date completed slicers. So I would like a grpah which plots tickets opened and closed in a given time, but for tickets opened to only have that slicer applied, and tickets closed to only have that slicer.

 

Hope that makes sense

11 REPLIES 11
Ashish_Mathur
Super User
Super User

Hi,

 

Share your data in a Table format which can be pasted in MS Excel.  Also, show your expected result.  Do not bother about the visual for now.  Once we can get the numbers correct, any visual can be built from it.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

I dont know how to share a table which can be pasted.

The problem I have is that tickets created and tickets completed are both dates

 

I have date of creation and date of completion

I would ideally like one slicer which is just DATE and anything is sliced by that date. But I do not have a DATE field, i have a 2 - create time and complete time.

 

If i sliced for February on create time, tickets completed are sliced wrongly. It will only show my tickets completed in february THAT WERE ALSO CREATED in February. I want tickets completed in February to be independant of anything else.

And I also want tickets created to be independant. 

 

Can I just have a default DATE slicer?

You can open in Excel and copy and pasting your data from there into here. The Rich Text field will convert it to a readable table format. Also we can create a Date table from where your slicer is used and add relationships to your other tables.



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
bdmichael09
Helper II
Helper II

Just so it's clear, you want the first measure included on this graph to be affected by both slicers. The other measure, you want to basically be static?

To be clear
I would like measure 1 filtered by slicer 1
Measure 2 filtered by slicer

And then plot both measures on the same line graph

I know how to get slicers to apply to visuals, but not measures

Thanks for the help so far
hnguy71
Memorable Member
Memorable Member

You can use selectedvalue

 

Measure =
VAR Slicer1 = SELECTEDVALUE(Table1[Date Opened], "something if not true")
return
CALCULATE([Measure], Table1[Date Opened] = Slicer1)


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Thanks for the quick reply..

Could you tell me how to do it for this data?

 

Table is Query1

ticket opened is create_time

ticket closed is date_completed

 

slicers are create time and date completed

 

 

So how would I create a measure for count of Query1[date_completed] by slicer date completed?

 

Thank you

Count Completed Based On Date = 
var DateSelected = SELECTEDVALUE(Query1[date_completed]) 
return
CALCULATE(COUNT(Query1[date_completed]), Query1[date_completed] = DateSelected)

I think this is what you're asking for....
However, you can really just do a count for date_completed and the slicer should automatically filter out for that specific date



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

The problem is

Create_time is a date, and Date_completed is a date

I do not want the value of create_time to be affected by the slicer for date_completed, and vice versa

 

I cannot see anything in the propsed solution which tells the measure to be filtered by a specific splicer?

You can change each slicer / visual interactions by selecting the slicer and click format. From there, you can choose what your slicer(s) do:

 

edit_interactions.PNG



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

That's just on visuals though isn't it?
I need to change what the slicer does on a measure

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.