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
Disco2021
Frequent Visitor

slicer like measure

i have slicer ( column from separate table ) , and i written measure for slicer (formula through switch ) when i use slicer , i want that in my report table filtered data like my slicer choice, but in resuit i see all data in table and data like slicer choice.

slicer measure =
VAR diff =
COUNTROWS ( 'summary by  customer data' )
RETURN
IF (
HASONEVALUE ( 'select'[selections] ),
SWITCH (
TRUE (),
VALUES ( 'select'[select id] ) = 1
&& [dif by customer] < 0, diff,
VALUES ( 'select'[select id] ) = 2
&& [dif by customer] > 0, diff,
VALUES ( 'select'[select id] ) = 3
&& ISBLANK ( [dif by customer] ), diff
),
diff
)

example 2.PNG

 

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @Disco2021 

do you mean, when you choose 2 in slicer, then the left table visual should show the 2 rows including Measure=2?

vxiaotang_0-1629710140415.png

actually, desktop cannot filter measure directly, maybe we can take a workaround.

could you share your sample file and expected result?

 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

 

selimovd
Super User
Super User

Hey @Disco2021 ,

 

I'm not really sure what you want to do. Can you maybe show us in Power BI what you want to do?

Also your measure does not make much sense for me. In all cases you return diff. Then you can just write:

slicer measure = COUNTROWS ( 'summary by  customer data' )

 

Also a measure cannot be used to slice. I think you might need a calculated column with the values from "Slicer measure". This column you can then use as a normal slicer.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

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.