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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.