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 there,
sorry for this beeing complicated but I try to explain my problem in detail
I wrote a measure to find out how many Distinct values are found in column in temporary table that is created out of another key column in the same table.
That temporary table is built up by using a FILTER() Function. My measure looks like this:
Solved! Go to Solution.
me again, I tried a bit and now it works with this here:
distinct Counter =
VAR __Column = [ColumnWithDuplikateValues])
VAR __Table = SELECTCOLUMNS(FILTER('TABLE_X', [ColumnWithDuplikateValues] = __Column),"__Column",[ColumnWithDistinctValues])
VAR __Result = COUNTROWS(DISTINCT(__Table))
RETURN
__Result
Just delete the MAX in the first row and the [__Column] in the COUNTROWS(DISTINCT( Function
and now it works fine 🙂
thank you very much!
@Anonymous Try this:
distinct Counter =
VAR __Column = MAX('TABLE_X'[ColumnWithDuplikateValues])
VAR __Table = SELECTCOLUMNS(FILTER('TABLE_X', [ColumnWithDuplikateValues] = __Column),"__Column",[ColumnWithDistinctValues])
VAR __Result = COUNTROWS(DISTINCT(__Table, [__Column]))
RETURN
__Result
me again, I tried a bit and now it works with this here:
distinct Counter =
VAR __Column = [ColumnWithDuplikateValues])
VAR __Table = SELECTCOLUMNS(FILTER('TABLE_X', [ColumnWithDuplikateValues] = __Column),"__Column",[ColumnWithDistinctValues])
VAR __Result = COUNTROWS(DISTINCT(__Table))
RETURN
__Result
Just delete the MAX in the first row and the [__Column] in the COUNTROWS(DISTINCT( Function
and now it works fine 🙂
thank you very much!
thanks for your suggestion.
The problem is I get an error when I use your code for a calculated column. the error says:
Too many argemtns passed --> problem is this here:
VAR __Result = COUNTROWS(DISTINCT(__Table, [__Column]))
I can only pass the __Table to this function. But now I get value cound 1 for everything so I think it does not work
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 |
---|---|
56 | |
55 | |
54 | |
37 | |
29 |
User | Count |
---|---|
78 | |
64 | |
45 | |
40 | |
40 |