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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
AlexisPREVOT
Helper III
Helper III

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

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.