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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Saxon10
Post Prodigy
Post Prodigy

Count based on the multiple column (DAX)

Hi,

 

Can you please advise regarding count based on the multiple column. I can't found any similar query in Power BI forum so I need advice on this query.

 

In Excel it's very simple formula but I don't know how can I archive in Power BI.

 

Excel formula =IF(COUNT(A2:G2)=1,"ONE",IF(COUNT(A2:G2)>1,"MULTIPLE"))

 

I am looking for new calculated column option.

 

Rule:

 

From Column A:G the total count is greater than 1 then the desired result is "Multiple".
From Column A:G the count is equal to 1 then the desired result is "one".

 

Data:

 

A13 A14 A15 A16 A22 A23 A26 DESIRED RESULT(IF FORMULA)
2 ONE
4 6 MULTIPLE
1 1 1 1 MULTIPLE
1 1 MULTIPLE
1 1 MULTIPLE
1 ONE
1 ONE
1 ONE
1 ONE
1 ONE
1 ONE
1 ONE
1 ONE
1 ONE
3 1 MULTIPLE
3 1 MULTIPLE
1 1 2 MULTIPLE
2 ONE
2 ONE
1 1 1 1 MULTIPLE
3 1 2 8 2 MULTIPLE
2 ONE
4 2 2 1 1 MULTIPLE
 

Snapshot of Desired result:

Count.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Saxon10 

I have used the below DAX to create a column

Desired Result = 
IF(IF(ISBLANK(Table1[A]),0,1) + IF(ISBLANK(Table1[B]),0,1) + IF(ISBLANK(Table1[C]),0,1) + IF(ISBLANK(Table1[D]),0,1) + IF(ISBLANK(Table1[E]),0,1) + IF(ISBLANK(Table1[F]),0,1) + IF(ISBLANK(Table1[G]),0,1) = 1, "One","Multiple")

and got the below output.

pranit828_0-1615442811183.png

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Saxon10 

I have used the below DAX to create a column

Desired Result = 
IF(IF(ISBLANK(Table1[A]),0,1) + IF(ISBLANK(Table1[B]),0,1) + IF(ISBLANK(Table1[C]),0,1) + IF(ISBLANK(Table1[D]),0,1) + IF(ISBLANK(Table1[E]),0,1) + IF(ISBLANK(Table1[F]),0,1) + IF(ISBLANK(Table1[G]),0,1) = 1, "One","Multiple")

and got the below output.

pranit828_0-1615442811183.png

 

Hi,

 

Thanks for your help and support. It's working well. 

PhilipTreacy
Super User
Super User

Hi @Saxon10 

 

Download sample PBIX file

 

Try this

 

Column = IF ([Column1]+[Column2]+[Column3]+[Column4]+[Column5]+[Column6]+[Column7] = 1, "One","Multiple")

 

sumcols.png

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Hi,

 

Thanks for your reply and sorry for the late reply.

 

Here I am looking for overall columns (from column 1 to 7) count equal to 1 then return is "One" and if not then return "Multiple" not individual column count. Please refer the snapshot were it will give a different result.

Capture.PNG

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.