Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi all,
I've been staring at this problem for a couple of days now, I'd greatly appreciate some help! Link to the .pbix file attached with dummy data.
My problem is, I cannot get the [Treaty Trip Count] measure to correctly count the number of trips where [TEST OVERALL] = "Pass". The output of this measure needs to be displayed in a card, using the dummy data, it should be displaying 4 trips, but it's currently displaying 7.
[Treaty Trip Count] is currently calculated with the following DAX:
Treaty Trip Count =
COUNTROWS(
FILTER(
VALUES(
'Travel Data'[Record ID]
),
[TEST OVERALL] = "Pass"
)
)
Allow me to explain the underlying data and what the rest of the measures are trying to achieve etc.
The issue is, all works final in the table (presumably because there's filter context in the table), but as soon as I pull it into a card, it's incorrect. Interestingly, as soon as I pull [Destination Country] out of the table, [Treaty Trip Count] is populated with 7 1s, which is presumably where this count of 7 is coming from (which is also the same result that I get in the column totals).
I'm still very new to DAX and Power Bi, I've tried modifying the filter context of the CALCULATE functions in every way you can think of, but I'm still coming up short. I'm guessing I'm missing some fundamental understanding of how measures evaluate?
I'm not sure if I'm asking the right question, but I'm guessing I somehow need to tell the measure what the table is it needs to evaluate without being in the context of a table visual?
Any help/explanations would be greatly appreciated. I'll be throwing my work laptop out on to the street if I have to look at this problem for much longer!
Thanks,
James.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
8 | |
7 | |
6 |
User | Count |
---|---|
14 | |
13 | |
11 | |
9 | |
8 |