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
Anonymous
Not applicable

Slicer (Measure Count)

Hello Everyone

Could you pls help me?

I have the following table in PowerBi. The "Has Paid?" column is a measure. And I would like to create a slicer which displays

Has paid? 1 or blank to filter the ones which are blank. 

Is there a way to insert this measure into a slicer?

NameAddressHas Paid?total records
xxxxxxyyyyy11
aaaabbbb 1
cccccdddd11
dddddeeee 1
dddddrrrrrr11

 

1 ACCEPTED SOLUTION

Hi  , @Anonymous

Measure  cannot be used in  slicer.It is recommended that you convert the measure into a calculated column and use it as a filter if possible.

 

In addition ,here  is another workaround .
1.Create a seperate table ( use the new field  "Has paid" as  a slicer)

2.Create  a measure as below   and  apply it to the visual filter pane:

 

visual control = IF([Measure Has paid] in DISTINCT('Seperate table'[Value]),1,BLANK())

 

 

The result will show as below:

34.png

Sample pbix attached

 

View solution in original post

10 REPLIES 10
Tahreem24
Super User
Super User

@Anonymous ,

Can you please share the DAX for your measure so we can try to convert it into Column.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
Anonymous
Not applicable

Hi @Tahreem24 

Thanks for your reply

I will share it as long as getting back to the office.

 

 

Hi  , @Anonymous

Measure  cannot be used in  slicer.It is recommended that you convert the measure into a calculated column and use it as a filter if possible.

 

In addition ,here  is another workaround .
1.Create a seperate table ( use the new field  "Has paid" as  a slicer)

2.Create  a measure as below   and  apply it to the visual filter pane:

 

visual control = IF([Measure Has paid] in DISTINCT('Seperate table'[Value]),1,BLANK())

 

 

The result will show as below:

34.png

Sample pbix attached

 

Anonymous
Not applicable

Thank you @v-easonf-msft . Worked perfeclty. 🙂

Anonymous
Not applicable

Hello @Tahreem24 

 

See the DAX below

 

Has Paid? =
IF (
[TotalActivePayersCount] = BLANK (),
BLANK(),
DISTINCTCOUNT ( Payments[ID] )
)

@Anonymous 

Try copying the same in Column and use in the slicer.

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
AiolosZhao
Memorable Member
Memorable Member

Hi @Anonymous ,

 

You can try to put the measure into the filter pane on the right side.

 

Then you can filter the measure.

 

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

Thanks for your suggestion. @AiolosZhao 

Actually, I would like to create the slicer to give the user the option to filter the data. This is why I have asked about it

Anonymous
Not applicable

Hi @AiolosZhao 

 

From a user point of view, it will be more user friendly to have a slicer on top of the table which allows the user to filter.

 

Thanks for your suggestion, anyways 

can you change the measure to a calculated column?

 

by the way, the user can also use the filter pane to filter the measure in the front-end.

 

Aiolos Zhao





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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