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
artblakey
Helper I
Helper I

Visual not filtering correctly

Hi friends,

 

Hope someone can assist me please.

 

I'm currently using three visuals in PowerBI:

1. A bar chart for different currencies and corresponding volume (eg. AUD, EUR. GBP etc.)

2. A card with a gross volume amount - Measure: Gross = CALCULATE(SUM(Bulking[Gross]),Bulking[Count] = 1)+0

3. A card with a net volume amount - Measure: Net = CALCULATE(SUM(Bulking[Net]),Bulking[Count] = 1)+0

 

I also have two Tables:

- A "Currency" table with the below columns (for the bar chart):

A: Date

B: Currencies

C: Volume Amount

 

- A "Bulking" table with the below columns (for the Cards):

A: Date

B: Currency (A currency is listed here if there is a netting opportunity, otherwise the cell is blank)

C: Gross Volume Amount (currency gross amount is listed here if there is a netting opportunity, otherwise the cell is blank)

😧 Net Volume Amount (currency netamount is listed here if there is a netting opportunity, otherwise the cell is blank)

E: Count (number 1 if there is a netting opportunity, otherwise the cell is blank)

 

I have a Slicer that filters by Year and Month.  The Slicer works as intended for the page, meaning that when I select a month and year, if filters the Currency bar chart and the two Cards correctly as expected.

 

The problem happens after I select a year/month, and then try to filter further by selecting a specific Currency from the bar chart.  I would expect the cards to filter down to the next level as well and give me the gross/net amounts for that specific Currency, but instead they remain unchanged.

 

What am I missing here?  I tried to change the relationships but was unsucessful, but truthfully I'm not really sure what the relationships should be.  Is there a dax option I could try out instead?

 

Thanks in advance.

 

16 REPLIES 16
artblakey
Helper I
Helper I

Currencies Results.JPGCurrencies Relationships.JPG

As suspected, the direction of relationships in the model doesn't allow the filtering.

You can read up on this here https://radacad.com/what-is-the-direction-of-relationship-in-power-bi 

 

 

Hi @HotChilli  and @v-yiruan-msft ,

 

Thanks for the information.  I read the article and changed the cross filter direction between the Date and Currency table from Single to Both.  This did change the values in the Cards, but not really as expected.  I could not figure out how to share the file via OneDrive, but here is the sample data of the tables:

 

Bulking Table:

 

DateCurrencyGross VolNet VolCount
1/04/2020AUDUSD                 143,259.93                 142,439.251
3/04/2020AUDEUR                 111,351.11                 111,301.291
30/04/2020AUDUSD                 201,375.78                    96,021.721

 

Currency Table:

 

DateCurrencyVolume
1/04/2020AUDUSD                     23,819.65
1/04/2020AUDUSD                     12,711.68
1/04/2020AUDUSD                           410.34
1/04/2020AUDUSD                     43,228.76
1/04/2020AUDUSD                                0.36
1/04/2020AUDUSD                           138.22
1/04/2020AUDUSD                     10,272.25
1/04/2020AUDUSD                     52,678.67
1/04/2020AUDEUR                     45,059.40
1/04/2020AUDEUR                     38,674.01
3/04/2020AUDEUR                   107,396.14
3/04/2020AUDEUR                        3,930.06
30/04/2020AUDUSD                     66,612.06
30/04/2020AUDUSD                     52,677.03
30/04/2020AUDUSD                        4,862.65
30/04/2020AUDUSD                        6,748.07
30/04/2020AUDUSD                     40,170.37
30/04/2020AUDUSD                     29,950.85

 

When I click on AUDUSD in the bar chart, I get the correct result:

AUDUSD Correct.JPG

 

 

 

 

 

 

But when I click on AUDEUR, I get incorrect figures for some reason:

 

AUDEUR Incorrect.JPG

 

 

 

 

 

 

What I am expecting for AUDEUR is:

Gross: 111,351.11

Net: 111,301.29

 

Am I doing something wrong with the relationships?

 

Thanks in advance.

Hi @artblakey ,

Please create the relationship between Bulking and Currency table based on field "Currency".

create relationship.jpgAUDEUR.jpg

Best Regards

Rena

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

Hi @v-yiruan-msft 

I created the relationship as suggested, but I'm still getting the same result.  I also have a Dates table (based on field "Date") so I'm not sure if this is affecting the result?  This is how the relationships are currently set up:

 

Currencies Relationships 2.JPG

Hi @artblakey ,

Please active the relationship which be created between Bulking and Currency table based on Currency field and de-active or remove the left 2 relationships.

active relationship_0.JPG

active relationship.JPG

Best Regards

Rena

 

 

 

 

 

 

 

 

 

 

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

Hi @v-yiruan-msft ,

 

Thanks for the suggestion.  The problem is that I have other visualizations that use the relationship between the Currency table and Dates table (based on Date field).  If I remove this relationship then it throws off the other visualizations which run off a Year/Month Slicer.

 

Is there a way to run both of these relationships at the same time (Dates/Currency and Bulking/Currency)?

 

Thanks for your help on this.

 

Hi @artblakey ,

Could you please share your sample pbix file with me if it is convenient? Later I will check if there is any other method/workaround to achieve it base on your report file. You can upload it to OneDrive for Business and share the link with me. Thank you.

Best Regards

Rena

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

Hi @v-yiruan-msft 

 

Here is the link for the pbix file from OneDrive.  Please let me know if you have any questions.

 

Thanks.

 

https://1drv.ms/u/s!ArgKVdagPZNkd9ih385H3_mX5X4?e=Xnp7Yf

Hi @artblakey ,

Sorry for late response. I made some changes on your provided report file to update the formula of measure Gross and Net as below:

Gross = CALCULATE(SUM(Bulking[Gross Vol]),FILTER('Bulking',Bulking[Count] = 1&&'Bulking'[Currency]=SELECTEDVALUE('Currency'[Currency],"AUDEUR")))+0
Net = CALCULATE(SUM(Bulking[Net Vol]),FILTER('Bulking',Bulking[Count] = 1&&'Bulking'[Currency]=SELECTEDVALUE('Currency'[Currency],"AUDEUR")))+0

filter not correct.JPG

You can get the updated report file from this link.

Best Regards

Rena

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

Hi @v-yiruan-msft 

 

Thanks for your reply and for taking the time to help me out.

 

I looked at the changes but it's not quite giving me the desired results.  Apologies as I probably wasn't clear on what I was expecting as the end result.  Here is a summary of what I am expecting to see from this report:

 

April:

 

APRIL Total Volume
(from Currency table) 
 Gross
(from Bulking table) 
 Net
(from Bulking table) 
% Difference
ALL SELECTED                            539,340.57                      455,986.82                    349,762.2623.3%
AUDUSD                            344,280.96                      344,635.71                    238,460.9730.8%
AUDEUR                            195,059.61                      111,351.11                    111,301.290.0%

 

May:

 

MAY Total Volume
(from Currency table) 
 Gross
(from Bulking table) 
 Net
(from Bulking table) 
% Difference
ALL SELECTED                         1,078,681.14                      911,973.64                    349,762.2661.6%
AUDUSD                            688,561.92                      689,271.42                    238,460.9765.4%
AUDEUR                            390,119.22                      222,702.22                    111,301.2950.0%

 

It appears with the changes you made, it does work properly when you select and click on either currency, but it is not working correctly when all currencies are selected.  For example, for April, when all currencies are selected (no currency filter), I'm expecting a Gross volume of $455,986.82 and Net volume of $349,762.26, with a Percentage Difference of 23.3%.  The screenshot below is showing the current results which are incorrect.

 

Currencies Results 15.06.20.JPG

 

I also wanted to mention that this report will be generated on a regular basis, and it will have multiple currencies in future, not just the two shown on this file, but the calculations will always be the same.

 

Please let me know if I can provide any other information.

 

Thanks.

Hi,

 

Is anyone able to help me with this please?

 

I appreciate all the help from everone so far and it seems like It's getting close, but just need a little more help to get over the line.

 

Thank you.

v-yiruan-msft
Community Support
Community Support

Hi @artblakey ,

Could you please provide some sample data in Currency and Bulking table? Is there any relationship created between these two tables? Where the field applied to the slicer come from? From a date table or Currency table?

Best Regards

Rena

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HotChilli
Super User
Super User

We will need to see the relationships and are there any other tables?  

The date slicer filters both tables so that would imply a date table.  Is that right?

It's possible that the nature and direction of the relationships in the model don't allow the Currency table to filter the Bulking table.

Hi @HotChilli  and @v-yiruan-msft 

 

Thanks for your response.  I re-created the data on a new report, but I cannot figure out how to upload the PBIX file, or if I'm even allowed to upload the file.  Please let me know if I can do this to make things easier.  For now I will attach images:

 

Yes, I am using a date table and the relationships are as below.  I have also attached the Desktop image with the bar chart and cards.  As I mentioned, the cards work well with a Slicer panel, but when I click on one of the individual currencies, the cards should change and they do not.

 

Please let me know if I can provide any other information.

 

Thanks.

 
 

Hi @artblakey ,

You can upload your pbix file to OneDrive for Business and share the link with us. Or you can provide some sample data in these three tables. Thank you.

Best Regards

Rena

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

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.