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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
chulpanvl
Helper I
Helper I

Wrong filtering in measure

Hello everyone!

 

I have a fact data with lower level of income and expense items given by the column "pokazatel" and monthly budget/actual values.

chulpanvl_0-1658936986580.png

 

I also have several dimension tables that contain upper levels of income and expense items.
The hierarchy is the following:
Показатели (upper) > statia_BI (middle) > statia_OIK (lower level)

So my model data looks like this

chulpanvl_1-1658937024714.png


I want to create a measure which returns a sum of actual values filtered by a given upper level item "Оплата прочим собственникам"

test = CALCULATE(sum('bdr'[fact_mn]), 'Справочник_группы статей'[Показатели] = "Оплата прочим собственникам")

And I want to see how all levels of items contribute to this measure.
But smth odd happens when I put all of these in a table. The upper level is not shown correctly, column Показатели contains other items too.

chulpanvl_2-1658937085150.png

 

Could you pls give me any hints what I'm doing wrong? than you!

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

Hi, @chulpanvl ;

You could try it.

test = CALCULATE(sum('bdr'[fact_mn]), FILTER('Справочник_перевертыш - > группы',[group_statia_BI] = "Оплата прочим собственникам"))

The final show:

vyalanwumsft_0-1659342747796.png


Best Regards,
Community Support Team _ Yalan Wu
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

5 REPLIES 5
v-yalanwu-msft
Community Support
Community Support

Hi, @chulpanvl ;

You could try it.

test = CALCULATE(sum('bdr'[fact_mn]), FILTER('Справочник_перевертыш - > группы',[group_statia_BI] = "Оплата прочим собственникам"))

The final show:

vyalanwumsft_0-1659342747796.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

chulpanvl
Helper I
Helper I

@lbendlin Hi! Thank you for your answers. I managed to replicate the issure even with 1 to many and single directional relationship. I updated the sample board, it's under the same link. 

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. I cannot help you without usable sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive. I cannot use screenshots of your source data.
Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

@lbendlin I've prepared a dashboard to play around with it. You can find it here pbix.

The problem is that I get a row duplicated in a table visual.

chulpanvl_0-1659084608023.png

 

Thank you for providing the sample data. That helps a lot with proposing a potential solution.

 

Your data model needs some attention.  Identify which tables are facts, which are dimensions, and which can be combined.  Ideally ou want to end up with single direction 1:M relationships, not with 1:1, and not with bidirectionals.

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.