Skip to content

DISTINCTCOUNT

The DISTINCTCOUNT function in Infoveave calculates the number of unique, distinct values in a column or dataset. It counts how many different items are present without considering duplicates.

Applicable to

  • Calculated Columns
  • Expressions

Return Value

  • The return value of the DISTINCTCOUNT function is an integer representing the count of unique, non-duplicate values in the specified column.

Remark

  • DISTINCTCOUNT is useful when you want to know how many distinct items are in a particular column, such as counting the number of unique customers, products, or categories.
  • DISTINCTCOUNT function can be used across Date, Strings and Numbers.
  • DISTINCTCOUNT function takes all values into account.

Syntax

DISTINCTCOUNT(<expression>)

DISTINCTCOUNT in Board Expression

ParameterDescription
ExpressionA placeholder in a function that is replaced with the actual widget and measure names.
Widget NameThe specific name or identifier of the widget being used for data visualization in the specific Infoboard.
MeasureRepresents the name of the measure that is being displayed or analyzed using the widget.

Steps to Use DISTINCTCOUNT

  1. Write the DISTINCTCOUNT function. For instance DISTINCTCOUNT(<expression>)
  2. Replace <expression> with 'Widget Name'[Measure]. Replace Widget Name with the actual name of your widget and Measure with the corresponding measure name.
  3. Set the condition with the DISTINCTCOUNT function based on the scenario. For instance, you can set the count entries that meet a certain criterion, as the condition.
  4. To learn how to configure an Expression in Infoveave, visit the section Configure Expression.

Scenario You’re overseeing a dataset and an Infoboard titled ‘Green Solar’ within your Energy Consumption Analysis System. Your goal is to count the number of unique solar customers without counting any customer twice. This is vital for assessing customer engagement and ensuring data accuracy.

Scenario Details

  • Dashboard Name Consumption Analysis
  • Widget Name Green
  • Measure Name Customers (representing the number of customers)

Objective Your objective is to count the number of unique customers without counting any customer twice. If this count equals 100, you want to trigger a specific action on your dashboard.

  • You can use the DISTINCTCOUNT function like this
DISTINCTCOUNT('Green'[Customers])=100

DISTINCTCOUNT in Calculated Columns

ParameterDescription
ExpressionA placeholder in a function that is replaced with the column names.
Column NameThe name of the column in the dataset or Datasource that contains the values you want to analyze.

Steps to use DISTINCTCOUNT in Calculated Columns

  1. Write the DISTINCTCOUNT function. For instance DISTINCTCOUNT(<expression>)
  2. Replace <expression> with [Column Name]. Replace Column Name with the actual name of your column required.
  3. To learn how to add calculated columns in Infoveave, visit the section Calculated Columns.

Objective Consider that you have the below sales dataset, your goal is to count the number of distinct values in the column COUNTRY.

ORDER DATECOUNTRYCATEGORYUNIT PRICEMARKET PRICEQUANTITY
2024-01-03BrazilBaby Food38.4143.78742
2024-01-07JapanSpices45.5650.815520
Japan43.787410
2024-01-1832.30194
2024-01-22BrazilCosmetics28.33523.01097
2024-01-26Canada20.18523.01099
2024-01-04FranceCereal25.2628.79649
2024-01-09BrazilCereal44.57550.81558
2024-01-14BrazilSnacks20.1854
BrazilCosmetics40.48546.15292

You can use the DISTINCTCOUNT function like

DISTINCTCOUNT([COUNTRY])

The new calculated column “Total Entries” will return the total number of rows in the dataset considering nulls and blanks as 4.

ORDER DATECOUNTRYCATEGORYUNIT PRICEMARKET PRICEQUANTITYTOTAL ENTRIES
03-01-2024BrazilBaby Food38.4143.787424
07-01-2024JapanSpices45.5650.8155204
Japan43.7874104
18-01-202432.301944
22-01-2024BrazilCosmetics28.33523.010974
26-01-2024Canada20.18523.010994
04-01-2024FranceCereal25.2628.796494
09-01-2024BrazilCereal44.57550.815584
14-01-2024BrazilSnacks20.18544
BrazilCosmetics40.48546.152924