Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Olamum
Helper II
Helper II

Count multiple columns with true values

Change_1change_2change_3

TRUEFALSETRUE
FALSE TRUE
TRUETRUETRUE


First row result should be = 2 because true appears twice

second row = 1

third row = 3

 

 I want to count the value of each row = "True" in Powerbi 

2 REPLIES 2
Resolutions
Regular Visitor

@Olamum In Power BI, you can easily calculate the count of "True" values for each row using the DAX (Data Analysis Expressions) language.

 

Follow these steps to achieve the desired result:

Step 1: Load your data into Power BI:
Ensure that your data is loaded into Power BI, and the columns are appropriately named.

 

Step 2: Create a New Column for Counting "True" Values:
Go to the Power BI Data View. Right-click on your table, then select "New Column" from the context menu. Name the new column, for example, "TrueCount."

 

Step 3: Write the DAX Expression:
In the formula bar, write the DAX expression to calculate the count of "True" values for each row. The expression uses the functions `IF` and `COUNTROWS` to achieve this. Assuming your table is named "YourTable," and the columns are named "Change_1," "Change_2," and "Change_3," the DAX expression would be:

```DAX
TrueCount =
COUNTROWS(
FILTER(
YourTable,
[Change_1] = TRUE() ||
[Change_2] = TRUE() ||
[Change_3] = TRUE()
)
)
```

Step 4: Apply the Expression:
Press Enter to apply the DAX expression. Power BI will calculate the "TrueCount" for each row based on the conditions specified.

 

Step 5: Check the Results:
Navigate back to the Power BI report view, and you should see a new column named "TrueCount" displaying the count of "True" values for each row in your table.

 

Now, your Power BI report should display the desired count of "True" values for each row, as you described:

- First row result = 2 because "True" appears twice.
- Second row result = 1.
- Third row result = 3.

You can then use this "TrueCount" column in your visualizations or further analysis as needed.

It didn't work. It was adding all the rows that doesnt even have true value

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.