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 need a measure to return True if there is more than one unique value for each unique value in another column. So in the below example, it should return False for value 1 in ID1 (as there is only 1 unique value in ID2) but True for value 2 in ID1 (because there are 2 unique values in ID2).
ID1 | ID2 | Value |
1 | A | 1 |
1 | A | 2 |
1 | A | 3 |
2 | A | 1 |
2 | A | 2 |
2 | A | 3 |
2 | B | 1 |
2 | B | 2 |
2 | B | 3 |
Thank you!
Solved! Go to Solution.
Hope this Measure works for you:
Unique = IF( CALCULATE( DISTINCTCOUNT( 'Table'[ID2] ),
ALLEXCEPT( 'Table','Table'[ID1] )) = 1,
"False", "True" )
Regards,
Hope this Measure works for you:
Unique = IF( CALCULATE( DISTINCTCOUNT( 'Table'[ID2] ),
ALLEXCEPT( 'Table','Table'[ID1] )) = 1,
"False", "True" )
Regards,
UPDATE: I forgot that my file was a csv, which was preventing me from adding measures. 😅
However, I'm not sure that it's working right now that I was able to create it. What is the way that this could be created as a calculated column, @tgjones43 ?
----
Hello. I think this solution is just what I need for my own data except I don't understand where to put this function. I'm sure this is very basic information but can you please demonstrate where I put this? My data is a table loaded from a power query query.
When I try to put it in as a step in my query I get an error "Expression.Error: The name 'IF' wasn't recognized. Make sure it's spelled correctly." If I change "IF" to "if" I get an error saying then is expected, then else is expected then "Token Eof expected". If I then remove the ) at the end it says "CALCULATE" isn't recognized.
I get the same when I try to make this a function.
If this is supposed to be a pivot table measure, I can't figure out how to get a measure in (the options under power pivot are always all greyed out, even when I add a pivot table).
Any help would be apprectiated.
This was originally created as a DAX Measure.
What you are doing above is trying to use DAX as an M Query in PQ.
Once you have loaded all of your data, go to your Power BI report and create a "New Measure.
Hope this helps.
Regards,
@rsbin it does, thank you! As a calculated column, rather than a measure, but that's fine.
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 | |
9 | |
8 | |
8 |
User | Count |
---|---|
14 | |
12 | |
11 | |
11 | |
8 |