cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DECOVIOTI
Helper III
Helper III

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  , @DECOVIOTI

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

@DECOVIOTI ,

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 , and Fortune 500 Companies Analysis

Hi @Tahreem24 

Thanks for your reply

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

 

 

Hi  , @DECOVIOTI

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

 

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

Hello @Tahreem24 

 

See the DAX below

 

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

@avioti1 

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 , and Fortune 500 Companies Analysis
AiolosZhao
Memorable Member
Memorable Member

Hi @DECOVIOTI ,

 

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!




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

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
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors