Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Change_1change_2change_3
TRUE | FALSE | TRUE |
FALSE | TRUE | |
TRUE | TRUE | TRUE |
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
@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
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
71 | |
67 | |
51 | |
39 | |
26 |
User | Count |
---|---|
87 | |
54 | |
45 | |
40 | |
36 |