The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Dear Forum,
Since my last post, I have learned much about filter and row context, iterators etc... This has really opened my eyes to the capabilities of DAX, and allowed me to answer many of the questions I once had. However there is still one things that puzzles me.
I am working with a table that contains information about locations. I have around 500 unique identifies for stores, each store has an ID, a name, a region, and other identifiers that are not unique. What I want to achieve, is a count of stores that will reflect the user chosen filters for all non unique slicers (so all slicers just not including the slicer for store ID or name).
Currently, I have a card that shows just that, displaying a measure that states:
calculate(count(location[id]), all(location[id]))
In theory, this should allow the user to select region, store group, and other slicers that would return multiple unique store IDs, as well as a specific store, yet still return only the count of the stores within the region and group etc...
However, this n of stores changes when selecting a single store, despite that specific column which populates the slicer being included in the all() function. Furthermore, it does not filter down the count to 1 as one would expect if the filter were in fact applied, it only removes some values. Another weird observation is that when looking at the filters applied to that specific card with the little dustbin icon, I can see the filter for store name still applied which would really make me think that the n would be 1. I have checked, there is no cyclic relationship present.
Before anyone says, just turn off the interaction between that slicer and the card, I need it to interact since in the end, that card should show the rank of the selected store and the total number of stores in the comparisson group using the rank function. Indeed, stopping interaction will return the correct n of stores, but rank 1 every time.
I would like to avoid hard coding a selected value var in all code since many visuals on the page should get affected by the individual store slicer, although I am afraid this may be the only solution.
Let me know if my question needs further explaining, or if sample data is needed.
Hope everyone has a good week.
Again, the nature of my data is sensitive and so I can't share it, but am more than happy to make an example dataset that reflects this weird behavior if anyone desires it.
Hi @DAX_merchant ,
Thanks for reaching out to us with your problem. Base on your description, it seems that you want to get the count of location id which not effect by the filter or slicer. In order to get a better understanding on your problem and make the further troubleshooting, could you please provide the following info? It would be helpful to find the solution.
It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Thank you for the response @Anonymous . I have actually found out what is being filtered out, and it has to do with a report level filter. To answer the questions you asked as well: No fields from different tables, and no relationships as I created a copy of the table and the issue persisted.
My question now is: I have a report level filter with 5 categories, only 2 of which should be shown. There is no slicer on the page with that particular column.
When I do the count of distinct locations, I use all(location[id]) as described above, so it should remove all filters on location ID but not on anything else. This is reflected in the count as for example, I have a slicer for region, which when selected will count only those in that region, but another slicer for store type, which if left unselected will still show all stores in that region. Now, the report level filter, for those two categories out of the 5, is overriden with the category that the selected store ID belongs to. So if the ID selected is category A, then the count will only include category A stores.
Why does this only affect the report level filter?