- Published on
Power BI DAX- DISTINCT and VALUE
- Authors
- Name
- Emre Koc
- @58emrecan
Power BI DAX- DISTINCT and VALUES
Hello today we are going to review some of important DAX functions. I attempt to introduce you these DAX function's features and how to implement on you line for report.
First DAX function we begin is Distinct.
Distinct :
DAX Distinct function, Returns a one-column table that contains the distinct values from the specified column. In other words, duplicate values are removed and only unique values are returned. it's explained by EnterpriseDNA.
Additionally It could be Column Name or TableExpression. The point I want to highlight is only unique values returned and duplicate values removed by DISTINCT.
Generally we use with COUNT functions. Let's get review in action. in order to start we create a new table.
DISTINCT Example = DISTINCT(Promotion[PromotionName])
This is the basic reviw for PromotionName ıf we look at Promotion Name , we are going to see duplicate value.
Consider the situation you can handle over 100000000000+ data value and Distinct save your time.
As you can see how it removes duplicate value. When you decided to implement it on report stage. and also Blank is not a value for Distinct function but Values
We highly recommend you using with COUNTROWS.
VALUES
In a column name, it differs from an identical column of text. A table in a table name that contains the same rows and all the rows of the table (including duplicates) with additional blank rows if any.
It works like Distinct but just have one difference.
The difference is Blank. Values return the blank but Distinct doesn't.
VALUES Example = VALUES('Calendar'[Year])
You can compare the difference
For compare I refer to SQLBI because they are really good at Power BI and I benefit from their resource.
- DISTINCT retrieves the distinct values of a column
- VALUES does the same.
- They differ in the way they handle the blank row,
- DISTINCT does not return the blank row, VALUES does.
Learn more at the SQLBI
Thank you for reading my content you can leave a comment to contribute my content.