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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Fátima
Helper II
Helper II

DAX help - measure - number of items checked (mode)

Hi!

 

I'd swear I just posted this question, but now I can't find it anywhere.

 

I have a table like this:

COMP     ANSWER       CHECKED

1             1                    1

1             2                    0

1             3                    0

1             4                    1

1             5                    0

2             1                    0

2             2                    1

2             3                    0

2             4                    0

2             5                    1

3             1                    0

3             2                    1

3             3                    1

3             4                    1

3             5                    0

4             1                    1

4             2                    0

4             3                    0

4             4                    0

4             5                    0

5             1                    1

5             2                    1

5             3                    1

5             4                    1

5             5                    1

 

I need a measure that tells me the "mode" of how many "ANSWERS" have checked the column "COMP". For example, in this case:

COMP 1 has checked 2 answers

COMP 2 has checked 2 answers

COMP 3 has checked 3 answers

COMP 4 has checked 1 answer

COMP 5 has checked 5 answers

 

The most repeated case is that a COMP checks 2 answers, son I need the measure to return 2.

 

Is this possible?

 

Regards!

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1677004540229.png

 

 

Expected result measure: = 
VAR _newtable =
    GROUPBY (
        ADDCOLUMNS (
            DISTINCT ( Data[COMP] ),
            "@checkedcount", CALCULATE ( COUNTROWS ( Data ), Data[CHECKED] = 1 )
        ),
        [@checkedcount],
        "@countrows", SUMX ( CURRENTGROUP (), 1 )
    )
VAR _maxcountrows =
    MAXX ( _newtable, [@countrows] )
RETURN
    _maxcountrows

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Hi! Thanks for your answer!

 

I don't think it does what I need, because if I change the checks (in the COMP 1 I set 3 checked instead of 2), the expected result should be 3, and in your pbix I still get 2.

 

Regards!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors