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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
madhav2020
Frequent Visitor

DAX query to calculate count of filled cells in selected column range

Hey Folks,

 

Just a quick help needed in counting totals number of filled cells in selected range of columns.

 

Here is the problem statement.

 

Employee NameT100T200T300T400
JohnBasic    
rubin    
kumarBasic    
Johnathon    
Steve    
JamesBasic  Advanced-1 
Cherry    
Rishab    
SandraBasic    
AliBasic   Advanced-2
Annet Intermediate  
NatashaBasic    
parveezBasic Intermediate  
IbrahimBasic  Advanced-1 
josephBasic    
AroldBasic  Advanced-1 
Aseen    
Niraj    

 

 

I would like to get a total count from column T100 to T400 as Total_Count= 16

 

Thanks in advance for your help

 

 

2 ACCEPTED SOLUTIONS
Fowmy
Super User
Super User

@madhav2020 

Use this measure to get the count:

Measure = 

VAR  T = 
    FILTER(
        UNION(
        SELECTCOLUMNS('Table',"C1", 'Table'[T100]),
        SELECTCOLUMNS('Table',"C2", 'Table'[T200]),
        SELECTCOLUMNS('Table',"C3", 'Table'[T300]),
        SELECTCOLUMNS('Table',"C4", 'Table'[T400])
        ),
        [C1] <>BLANK()
    )   
    
RETURN
   COUNTROWS(T)

 

________________________

If my answer was helpful, please mark it as a solution

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube
LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

v-alq-msft
Community Support
Community Support

Hi, @madhav2020 

 

Based on your description, you may create a measure as below . The pbix file is attached in the end.

Total Count = 
SUMX(
    ADDCOLUMNS(
        'Table',
        "Count",
        var tab = {[T100],[T200],[T300],[T400]}
        var result =  
        COUNTROWS(
            FILTER(
                tab,
                [Value]<>BLANK()
            )
        )
        return 
        IF(
            ISBLANK(result),
            0,
            result
        )
    ),
    [Count]
)

 

Result:

c1.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-alq-msft
Community Support
Community Support

Hi, @madhav2020 

 

Based on your description, you may create a measure as below . The pbix file is attached in the end.

Total Count = 
SUMX(
    ADDCOLUMNS(
        'Table',
        "Count",
        var tab = {[T100],[T200],[T300],[T400]}
        var result =  
        COUNTROWS(
            FILTER(
                tab,
                [Value]<>BLANK()
            )
        )
        return 
        IF(
            ISBLANK(result),
            0,
            result
        )
    ),
    [Count]
)

 

Result:

c1.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

What does [Value] mean in your DAX?

Fowmy
Super User
Super User

@madhav2020 

Use this measure to get the count:

Measure = 

VAR  T = 
    FILTER(
        UNION(
        SELECTCOLUMNS('Table',"C1", 'Table'[T100]),
        SELECTCOLUMNS('Table',"C2", 'Table'[T200]),
        SELECTCOLUMNS('Table',"C3", 'Table'[T300]),
        SELECTCOLUMNS('Table',"C4", 'Table'[T400])
        ),
        [C1] <>BLANK()
    )   
    
RETURN
   COUNTROWS(T)

 

________________________

If my answer was helpful, please mark it as a solution

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube
LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors