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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
kaileena
Frequent Visitor

how to filter in query

Hello,

 

 

I paste here a sample of my data (Measurement table with all columns):

kaileena_0-1661352329263.png

Here is my slicer which contains a subset of Entity (Entity Reference Table column Entity PK).

(Measurement Table references Entity Table of course)

kaileena_2-1661352638954.png

The problem is that: i am forced to have a subset of entities in the slicer which actually represent the parent entities (Payer, pib...). They are parent entities for all the other entities which are also present in the Measurement table (i.e. Payer entity is parent for archery, karate, surfing ). In other words: in my Measurement Table in the column called Entity I have all the entities (parent plus children) whereas in the slicer I have to filter only on the parent entities. 

 

The relation parent-child can be seen by looking at the Cadence column from the Measurement Table.

 

Now I have to calculate the Story point measure for the child entities (since i do not already have an aggregate at parent entity level). I have so far:

 

kaileena_3-1661353255882.png

But it does not work....

 

 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @kaileena ,

 

Based on your description, I have modified yor measure, please try:

Value for Story Points Delivered = 
SWITCH(
    SELECTEDVALUE('Entity Reference'[Entity (PK)]),
    "Payer",
    CALCULATE(
        SUM(Measurement[Value]),
        FILTER(ALL(Measurement),
        'Measurement'[Type] in {"Story Points Delivered"}&&
        CONTAINSSTRING('Measurement'[Cadence],"PAYER") = TRUE()
    )),0)

Final output:

vjianbolimsft_0-1661753720930.png

vjianbolimsft_1-1661753738969.png

If the result is not what you want, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @kaileena ,

 

Based on your description, I have modified yor measure, please try:

Value for Story Points Delivered = 
SWITCH(
    SELECTEDVALUE('Entity Reference'[Entity (PK)]),
    "Payer",
    CALCULATE(
        SUM(Measurement[Value]),
        FILTER(ALL(Measurement),
        'Measurement'[Type] in {"Story Points Delivered"}&&
        CONTAINSSTRING('Measurement'[Cadence],"PAYER") = TRUE()
    )),0)

Final output:

vjianbolimsft_0-1661753720930.png

vjianbolimsft_1-1661753738969.png

If the result is not what you want, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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