Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello,
I just created a measure and a slicer that allows me to exclude items that I don't want.
For example :
My initial table :
My filtered table if I want to exclude ID Article = 1 :
The DAX Code associated is :
VAR d =
LOOKUPVALUE('ARTICLE'[ID ARTICLE], 'ARTICLE'[ID ARTICLE], MIN('Table ARTICLE'[ID ARTICLE]))
RETURN
IF (
ISFILTERED (Table ARTICLE'[ID ARTICLE]),
IF ( d IN VALUES ('ARTICLE'[ID ARTICLE]), 1, 0 ),
0
)
But I want to go further by "deleting" the visualization of the table all the companies that have an ID Article = 1
So my end result should be:
Please do you have an idea of the filter that I have to put in place to achieve this result?
Thanks in advance.
Alexis
Solved! Go to Solution.
Hi, @AlexisPREVOT
Why not just create a slicer for the ID field.
If you insist on using a measure, try creating the following measures:
_exclude = 1
_Flag =
IF ( 'Table'[_exclude] = MAX ( 'Table'[ID Article] ), 0, 1 )
Or the whatif parameter will work just as well
_Whatif flag =
IF('exclude items'[exclude items Value] = MAX('Table'[ID Article]),0,1)
There are many ways to achieve the result you want, choose the one you like
result:
Please refer to the attachment below for details
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @v-angzheng-msft ,
Sorry for the delay of my response.
Thank you for your solution which fully answered my request.
Have a good day.
Alexis
Hi, @AlexisPREVOT
Why not just create a slicer for the ID field.
If you insist on using a measure, try creating the following measures:
_exclude = 1
_Flag =
IF ( 'Table'[_exclude] = MAX ( 'Table'[ID Article] ), 0, 1 )
Or the whatif parameter will work just as well
_Whatif flag =
IF('exclude items'[exclude items Value] = MAX('Table'[ID Article]),0,1)
There are many ways to achieve the result you want, choose the one you like
result:
Please refer to the attachment below for details
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @parry2k ,
I just tested and it works if i force the value 'Table'[ID Article] = 1 to a given value.
It is true that I misspoke my request but I would like the "1" to be automaticly replaced by the value of my slicer.
It is possible ?
@AlexisPREVOT you have few ways to solve this, one is to add a column in your table and then use this column where value = 0
ID to Filter =
CALCULATE ( COUNTROWS ( 'Table' ), ALLEXCEPT ( 'Table', 'Table'[ID Enterprise] ), 'Table'[ID Article] = 1 ) + 0
Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
117 | |
101 | |
71 | |
61 |