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.
Hi, I've been pulling my hair out over this for 2 days now and I can't seem to get the result I want.
Essentially I've been trying to create a measure that will count all visits, regarless of the filter I have applied on 'Class 2'
I've tried dozens of different methods, but I think I'm misunderstanding something fundamental about how filters are applied accross relationships.
I'm starting with a variation on:
Total Visits = CALCULATE(COUNTROWS(Visits),ALL(accounts[class 2]))
however the filter is still applied.
An example of my data model is below
One thing you can do is create an alias (Go to Query Editor-> Right click on table ->Create Reference for Visits table )
A copy of your visits table will be created.
Now, you have 2 same tables for Visits. Make sure the duplicate one is not connected to any other table (Manage relationships)
Create your measure using this new table instead oforiginal one and keep everything else as is.
This measure should not be impacted by any filtering as the table is not joined with any other table in our model.
The logic looks correct to me. How do you know it is not working? I suggest create a matrix and put class 2 on rows. Then put the measure you wrote in the values for the matrix. From what I can see, it should return the same result all the way down the matrix = working as design.
Hi Matt,
Sorry about the slow response - I have been working on another project.
I tried your suggestion of putting it on a matrix, and I do not get the expected result
The first measure Total Visits is the same as in my initial posts
The Second Number of Visits is simply Number of Visists = countrows(visits)
They both return the same values - I can't seem to attach an image.
I'd rather achieve this with a measure rather than a second unrelated table as there are still things I do need to filter.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
98 | |
86 | |
70 | |
62 |
User | Count |
---|---|
151 | |
120 | |
103 | |
87 | |
68 |