Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
AlexisPREVOT
Resolver I
Resolver I

Error on a measurement serving as a filter

Hi,

 

I wanted to make a measurement that was to serve as a filter for a table.
My idea being to be able to delete certain rows from my table by excluding them.

 

So I wrote the following formula: 

 
Mesure 9 =
VAR h =
    LOOKUPVALUE('Requête2'[ARTICLES (2).article UNIVERS.NOM_UNIVERS], 'Requête2'[ARTICLES (2).article UNIVERS.NOM_UNIVERS], MAX('Table calculée'[ARTICLES (2).article UNIVERS.NOM_UNIVERS]))

RETURN
    IF (
            ISFILTERED ('Table calculée'[ARTICLES (2).article UNIVERS.NOM_UNIVERS]),IF (h IN VALUES ('Requête2'[ARTICLES (2).article UNIVERS.NOM_UNIVERS]), 1, CALCULATE(COUNTROWS('ENTITE'),ALLEXCEPT('ENTITE','ENTITE'[ENT_ID]),'Requête2'[ARTICLES (2).article UNIVERS.NOM_UNIVERS]=h)),0
    )
 
My idea seems to work but when in the visual filters I indicate that I don't want to display all the measures equal to 1, it deletes me rows while I do not select anything in my segment (the segment is 'Table calculée'[ARTICLES (2).article UNIVERS.NOM_UNIVERS] ).
 
 For example, the result when I do "display all" with measure 9 (and my segment is on "All")
 
AlexisPREVOT_0-1672064185525.png

 

And when I ask measure 9 is not 1

AlexisPREVOT_1-1672064333494.png

 

Can you help me please, because if without segment selection my basic screen is wrong, I don't understand how to have the right result at the end.

 

Thank you by advance.

1 REPLY 1
amitchandak
Super User
Super User

@AlexisPREVOT , You have use segmentation for that

 

examples

---- between value

Dynamic Segmentation Bucketing Binning
https://community.powerbi.com/t5/Quick-Measures-Gallery/Dynamic-Segmentation-Bucketing-Binning/m-p/1...


Dynamic Segmentation, Bucketing or Binning: https://youtu.be/CuczXPj0N-k

 

------Discrete value

Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

 

--- Text Value

 

Customer Retention with Dynamic Segmentation, New/Lost/Retain Customer Count: https://www.youtube.com/watch?v=W4EF1f_k6iY

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.