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

See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap

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

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.