Pivot Table Issues

How to Create a DAX Measure for Conditional Distinct Job Opening Counts

Bushra ParveenBushra Parveen Nov 13, 2026 869 views

Question details

The user needs a DAX measure that counts unique job openings by Profile, Location, and Job Title combinations in Microsoft Power BI or Power Pivot, ignoring repeated workflow stage rows.

How to Create a DAX Measure for Conditional Distinct Job Opening Counts
Product
Microsoft Power BI / Excel Power Pivot
Device & OS
not provided
Scenario
The user is building a dynamic report from a table where each profile can appear in multiple workflow stages, job titles, and locations, so a simple distinct profile count is not accurate.
Observed behavior
Simple COUNTROWS or DISTINCTCOUNT formulas do not produce the conditional distinct count because they either include repeated stage rows or fail to combine the required columns.
Before you start

Confirm that your Power Pivot or Power BI data model contains a table with Profile, Location, Job Title, and workflow stage columns, and that you have permission to create measures in the model.

Solution 1Recommended

Create a DAX measure with SELECTCOLUMNS, DISTINCT, and COUNTROWS

Use this measure when you need to count unique job openings based on Profile, Location, and Job Title combinations while ignoring workflow stage duplicates.

A DISTINCTCOUNT on a single column is not enough when one profile can appear in multiple workflow stages, job titles, or locations. This pattern first builds a one-row-per-combination table with SELECTCOLUMNS, then removes duplicates with DISTINCT, and finally counts the remaining rows.

1
Open the Power Pivot or Power BI measure area

In Excel Power Pivot, open the Power Pivot window and click in the calculation area; in Power BI, open the report and go to the Modeling tab.

2
Create a new measure

In Power BI, click New Measure on the Modeling tab. In Power Pivot, click an empty cell in the calculation area below the data table.

3
Enter the DAX formula

Type or paste: Job openings := COUNTROWS(DISTINCT(SELECTCOLUMNS(data,"P",data[Profile],"L",data[Location],"J",data[Job Title])))

4
Apply and use the measure

Commit the measure, set its number format to Whole Number, and then add it to the values area of a PivotTable or visual.

Create a DAX measure with SELECTCOLUMNS, DISTINCT, and COUNTROWS
Result: The measure counts each unique Profile-Location-Job Title combination once, so repeated workflow stage rows no longer inflate the total.
Free Microsoft Office alternative

Try WPS Spreadsheets for simpler pivot reporting without DAX

For users who find DAX and Power Pivot difficult to maintain, WPS Office provides a free, lightweight alternative. It opens and saves Excel workbooks, includes familiar spreadsheet and PivotTable tools, and handles common distinct-count reporting with helper columns and formulas instead of DAX.

  1. 1. Download WPS Office: Download WPS Office Free from the official WPS website and install it on your device.
  2. 2. Open your Excel workbook: In WPS Spreadsheets, click File > Open and select your existing .xlsx or .xls file.
  3. 3. Create a helper column for unique combinations: Add a column that joins Profile, Location, and Job Title, for example =A2&B2&C2, to identify unique job openings.
  4. 4. Build or refresh a PivotTable: Select the data, go to Insert > PivotTable, and set rows, columns, filters, and values for the report.
  5. 5. Count unique job openings: Use Remove Duplicates or COUNTIF on the helper column to count distinct job opening combinations.
Free to download and use on Windows, macOS, Linux, Android, and iOSOpens and saves .xlsx and .xls files with high compatibilityFamiliar Excel-like ribbon and PivotTable workflowLightweight installation that runs smoothly on everyday devicesSimpler helper-column and Remove Duplicates workflow for unique job opening counts
microsoft office alternative - wps office

Frequently Asked Questions

Why does DISTINCTCOUNT(Profile) return the wrong job opening count?

Because a profile can have multiple workflow stage rows, so DISTINCTCOUNT(Profile) counts each profile once and misses separate openings with different locations or job titles. Use the unique combination of Profile, Location, and Job Title instead.

Can I use this DAX measure in both Power BI and Power Pivot?

Yes, the SELECTCOLUMNS, DISTINCT, and COUNTROWS pattern works in both Excel Power Pivot and Power BI because they use the same DAX language.

How do I add the measure to my PivotTable or visual?

In Power Pivot, create the measure in the calculation area and then drag it into the values area of the PivotTable. In Power BI, click New Measure on the Modeling tab and then add the measure to a visual.

Will different locations for the same profile be counted as separate openings?

Yes, SELECTCOLUMNS creates rows with Profile-Location-Job Title combinations, so DISTINCT counts each different location or job title combination as a separate job opening.

Does WPS Office support DAX measures?

WPS Spreadsheets supports PivotTables and common formulas, but DAX measures are Microsoft Power Pivot and Power BI specific. In WPS, you can use helper columns and Remove Duplicates or COUNTIF to count unique job opening combinations.