Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
Good day.
I have the following measures which are supposed to count the amount of voyages a particular operator has done on a specific trade and timeframe. Also, I have a second measure, where I remove the operator column using ALL or REMOVEFILTERS, which is supposed to give me the total amount of voyages so that I can calculate the market share for each individual operator.
So far so good, everything is working as it should.
The problem starts when I try to slice the visual using the same Operator column I'm using REMOVEFILTERS on (I have several operators, and would only like to see the top/bottom ones for example, but I dont want the market share to change). I would have hoped that the Total Voyages column remains unchanged at 23, but for some reason it is showing 5, and I cant understand where this is coming from.
So I'm guessing there might be a basic thing here I'm completely overlooking. Does anyone know what this might be?
Sorry but I can't attach a sample file, hopefully I made myself clear enough. Thanks!
Hi @MDB
I'm really curious to understand where 5 comes from. Can you please share the sample data?
Hi @tamerj1
Thank you for replying. I've created a simplified sample which replicates my model, which you can find attached below. I also believe to have found what is causing this issue, although I have no idea why.
I thought the issue might show up because of the interaction with other slicers. I have several of them on my visualizations page which I use to fiter through my data, but for this particular sample I'm showing just 3 of them: Operator, Direction and Loading Month.
So lets say I want to look at just the voyages on direction 2 (which is equivalent to what i showed in my original post). As you can see, REMOVEFILTERS works just fine in this case, even when slicing for the Operator. Total voyages remains constant at 23.
The other slicer is the loading date, and this is what has been causing the problem all along. Once I start filtering by date, REMOVEFILTERS stops working properly. It now shows 21 instead of 23, and if you select B and E you'll get 6.
So it's definitely related to this date column, altough I still don't know why. At least I can work around it now, but any suggestions will be appreciated.
Thanks!
@MDB
now it makes sense. You are removing the filter from one column but keeping the filter from others. You may try
Total Voyages =
COUNTROWS ( ALL ( Voyages[Voyage ID] ) )
Hi @tamerj1
Yes, my intention is to remove the filter from the operator column, since I want to filter the rows on my visual (table) withouth affecting the calculations.
So for example, operator "A" performed 19 voyages of a total of 23 on direction "2". So far so good. But once I filter by another column (date in this example), the total calculation drops to 21.
COUNTROWS(ALL)) would not work in this particular case, since it would give me all rows in the table, and I've got several slicers that need to be applied to the data.
You can remove all filters and the ones you need manually using VALUES
=
COUNTROWS (
CALCULATETABLE (
'Table',
ALL ( 'Table' ),
VALUES ( 'Table'[Column1] ),
VALUES ( 'Table'[Column2] ),
VALUES ( 'Table'[Column3] )
)
)
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Check out the November 2024 Power BI update to learn about new features.
User | Count |
---|---|
21 | |
21 | |
21 | |
13 | |
12 |
User | Count |
---|---|
43 | |
28 | |
25 | |
23 | |
22 |