Chart & Visualization Issues

Use DAX Measures in a Power BI Clustered Bar Chart

Chanuka GeekiyanageChanuka Geekiyanage Nov 12, 2026 870 views

Question details

The user needs to display invoice and credit condition counts in a Power BI clustered bar chart using DAX calculations.

Use DAX Measures in a Power BI Clustered Bar Chart
Product
Microsoft Power BI
Device & OS
not provided
Scenario
The user wants to use DAX measures to provide both the category labels and the values in a clustered bar chart.
Observed behavior
DAX measures can return numeric results for chart values, but they generally cannot act as dynamic category fields on the chart axis.
Before you start

Confirm that you have separate measures for each condition, such as Invoice Count and Credit Count. Also identify whether the chart must respond to slicers, because calculated tables update on data refresh rather than every visual interaction.

Solution 1Recommended

Create a disconnected category table and a SWITCH measure

Use this approach when you need Invoice and Credit labels on the chart axis while keeping the counts responsive to report filters and slicers.

A clustered bar chart requires a column for its category axis. Create a small table containing the labels, then use one measure to return the matching existing DAX measure for each label.

1
Create category labels

In Power BI Desktop, select Modeling > New table and create a table such as: Chart Conditions = DATATABLE("Condition", STRING, {{"Invoice"}, {"Credit"}}).

2
Create a selector measure

Select Modeling > New measure and create a measure such as: Selected Condition Count = SWITCH(SELECTEDVALUE('Chart Conditions'[Condition]), "Invoice", [Invoice Count], "Credit", [Credit Count], BLANK()).

3
Build the clustered bar chart

Insert a Clustered bar chart, drag Chart Conditions[Condition] to the Y-axis or category axis, and drag [Selected Condition Count] to the X-axis or values well.

4
Test report filters

Select a slicer or add a visual-level filter and confirm that [Invoice Count] and [Credit Count] update through the Selected Condition Count measure.

Create a disconnected category table and a SWITCH measure
Dynamic chart categories: The disconnected-table method keeps category labels stable while allowing the displayed measure values to react to the report filter context.
Free Microsoft Office alternative

Create a Clustered Bar Chart from Summarized Data with WPS Spreadsheets

DAX measure behavior is specific to Power BI, but WPS Office provides a free, lightweight way to summarize exported report data and create clustered bar charts. Its familiar spreadsheet interface supports a smooth transition for users working with Microsoft Office files.

  1. 1. Open the exported workbook: Open the Power BI-exported XLSX file in WPS Spreadsheets from the WPS Office home screen.
  2. 2. Prepare category and count columns: Place condition labels such as Invoice and Credit in one column and their corresponding counts in the adjacent column.
  3. 3. Insert a clustered bar chart: Select the summary range, choose Insert > Chart, and select a Bar or Column chart with the clustered option.
Create clustered bar charts from invoice and credit summary data.Open and edit Microsoft Excel XLSX and XLS files with strong format compatibility.Use pivot tables and formulas to organize chart categories and counts.Work in a familiar, lightweight spreadsheet interface for quick reporting.
microsoft office alternative - wps office

Frequently Asked Questions

Why can’t I put a DAX measure on the category axis in Power BI?

A DAX measure returns a calculated scalar result in the current filter context, not a reusable column of category values. Use a table column, such as a Condition field, for the category axis.

Can I show multiple measures in a clustered bar chart?

Yes. Add a category column to the axis and add separate measures, such as [Invoice Count] and [Credit Count], to the Values field well. Power BI creates separate bars for each measure.

How do I make Invoice and Credit labels work with one DAX measure?

Create a small disconnected table in Modeling > New table with Invoice and Credit labels, then use SWITCH with SELECTEDVALUE to return the appropriate measure for each selected label.

Will a calculated table update when I select a slicer?

Calculated tables are generally evaluated during dataset refresh. For counts that must respond immediately to slicers and visual filters, use measures and a category table instead.

When should I reshape the data instead of creating separate measures?

Reshape the data when Invoice, Credit, and other conditions represent repeating category values. A single Condition column and one count measure are easier to expand and chart than many separate measures.