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

Need to create slicer with 'Yes or No' type to show values in table

PFB below pic regarding the table, if click 'Yes' in slicer, the table should show 'Aug 2020' values with their corresponding values in other columns

 

If i click 'No' in slicer, the table should show rest of it, like blank values of 'Aug 2020' with their corresponding values in other columns

 

Aug 2020 is the latest month, Jul 2020 is the previous month and also we one parameter to be selected which is one the supplier key = "SW" from 6 of supplier key 

 

Pls note, must not use buttons to show case this, as this the requirement we have from client.

 

Also, while all the values in the matrix are measures, not value from data table

 

sri_sengen_0-1599481086824.png

 

6 REPLIES 6
v-xicai
Community Support
Community Support

Hi   @Anonymous ,

 

Do the suggestions from engineers make sense? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.

 

Best regards

Amy

amitchandak
Super User
Super User

@Anonymous , Try a measure like existing measure =[Measure] , Slicers independent table use in the slicer having values Yes, No

 

if(isfiltered(Slicer[Value]) && selectedvalue(Slicer[Value]) ="No" && Max(Date[Month Year]) ="Aug 2020" , blank(), [Measure])

ibarrau
Super User
Super User

Hi @Anonymous, you can build a custom column with a condition that will show Yes or No. I will show you and example in DAX. Add a new Calculated Column in the table that contains the dates. This new column will show "Yes" for any value in the last month of the data or "No" in any other date.

LastMonth = 
VAR last_date = MAX(Table[Date])
RETURN
IF(
    AND(
        YEAR(last_date) = YEAR(Table[Date]),
        MONTH(last_date) = MONTH(Table[Date])
    ), "Yes"
    , "No"
)

Then you can add this column to slicer.

Hope this helps,


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

Happy to help!

LaDataWeb Blog

Anonymous
Not applicable

Now I have added another parameter which is to be selected, can you pls check again the condition and reply...

 

Aug 2020 is the latest month,

Jul 2020 is the previous month

One parameter to be added which is the supplier key need to be selected, which is Supplier key = "SW" from one of the six supplier keys

 

Also, thanks so you much for your reply regarding the first suggestion.

 

Thanks and Regards,

Sri Vignesh

Hi @Anonymous ,

 

>>One parameter to be added which is the supplier key need to be selected, which is Supplier key = "SW" from one of the six supplier keys

 

Would you like to create another slicer which contains Supplier key = "SW"  and  Supplier key = other , right ? If so, you may create calculated column like DAX below, and then put it into slicer.

 

 

Slicer_Supplier= IF(Supplier key = "SW", "SW", "Other")

 

 

Best Regards,

Amy 

Greg_Deckler
Super User
Super User

@Anonymous - You can create a disconnected table with the values

Yes

No

 

Then you can build the logic into your measure to only show August values and return blank for everything else if yes and vice versa for no.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.