Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi there,
I recently ran into the following issue. My team has since resolved it (included) but we don't know 'why' it is the resolution.
The ask: Calculate a Distinct Count of Values where the Primary Key IN a list of PK's defined by a subquery.
The strange thing is, that when we ran the subquery through DAX Studio by itself, it returned the expected results.
Thank you for taking a look!
The DAX that WORKED:
VAR _subq =
The DAX that DID NOT WORK:
VAR _subq =
Solved! Go to Solution.
Hi @prill22ta ,
Using a single column argument, ALL returns all the unique values of the column.
CALCULATETABLE (
ALL( table[field] ),
table[field2] = "Yes"
)
So this statement returns the unique value of the table[filed] column, and the following table[filed2]="Yes" does not play a filtering role for the previous statement, because the ALL function ignores all filters
Best Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @prill22ta ,
Using a single column argument, ALL returns all the unique values of the column.
CALCULATETABLE (
ALL( table[field] ),
table[field2] = "Yes"
)
So this statement returns the unique value of the table[filed] column, and the following table[filed2]="Yes" does not play a filtering role for the previous statement, because the ALL function ignores all filters
Best Regards,
Gallen Luo
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Both versions are a measure.
For the first dax code, is it a measure? what filter context does it have?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
19 | |
14 | |
10 | |
9 | |
9 |
User | Count |
---|---|
15 | |
12 | |
12 | |
11 | |
11 |