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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Bnb99
Frequent Visitor

Using the Correct DAX to count multiple rows as 1

I am very new to Power BI and DAX. I did a search to solve a problem with previous data using the Distinctcount code. it worked well in combining rows with the same value in the "record number colum". I am trying to the same thing, but with a diffrent colum. With the multiple records, I am trying to count the "true" as one event. (note this colum has both true and false values). What is the best way to go around doing this? The data is all on the same table, I think I am trying to filter out "true" in the distinct count, but not sure if I am explaining it correctley!

Power BI Question.PNG

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Bnb99 create a measure m1 = distinctcount(table1[recordnumber]) assuming record number is going to be unique accross all the injuries related to 1 persion in the visual level. in the chart visual filters or page level filter just select recordable = true

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@Bnb99 you are trying to calculate distinctcount of true per some variable. i am not sure which variable based on the information provided. can you post pic of the model and details on what you want to calculate, and what is the expected output.

POwer BI.PNGBI DAX.PNG

So what I am trying to measure is the number of incidents in a given month. (the image above in pink shows what I want to show in the visual.). In the previous post shows the column highlighted in grey, the incident  "record number".  If you move to the next column to the right, it identifes the body part that was injured. The data spilts up the incidents in to multiple rows if multiple body parts are entered in to the database, hence why you see three "312" record numbers, but it's only 1 incident. The final column shows true or false values. this is indicating that the incident resulted in an OSHA recordable (true meaning, yes it was an recordable incident). Currently, without any filtering, calculating, DAX or grouping the chart would show I have 3 OSHA recordables, but I really have one. How can I get the data, to look at the table and recognize that this as one event?

 

I want to avoid grouping as I noticed when using this feature, and more data is entered, the new data does not automatically get grouped, and I have to manually fix it. (unless I am doing that wrong....remember I am very new at all this!)  I was hoping using distincint count, and some kind of "filter" DAX would help.

 

Hopefully this clears up my question.

Anonymous
Not applicable

@Bnb99 create a measure m1 = distinctcount(table1[recordnumber]) assuming record number is going to be unique accross all the injuries related to 1 persion in the visual level. in the chart visual filters or page level filter just select recordable = true

Thank you! This works!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.