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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
139068
Regular Visitor

DAX Help

Need help with what I think is a simple DAX formula.  I have a visual that looks like this.  The count field is ia measure I defined in a DAX formula that defines the count field as either 1 or 0.  For some reason when I turn on the option to show totals for this visual, the count shows as 0

139068_0-1693312841616.png

I want to be able to sum up the count field to the country level, so that I can get a total for Argentina of 3.  Instead of showing 3, the value shows 0.  

I've tried various DAX formulas but can't get it.  The count field is a measure I define in a DAX formula that results in a value of either 1 or 0.

 

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

May be your Count measure can be modified to get the correct total but since i do not know what that measure is, try this one

Measure = IF(HASONEVALUE(Data[District]),[Count],SUMX(VALUES(Data[District]),[Count]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

You are welcome.  If my previous reply helped, please mark that as Answer.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

May be your Count measure can be modified to get the correct total but since i do not know what that measure is, try this one

Measure = IF(HASONEVALUE(Data[District]),[Count],SUMX(VALUES(Data[District]),[Count]))

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi...Your solution did it!...thanks

You are welcome.  If my previous reply helped, please mark that as Answer.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
vicky_
Super User
Super User

Try something like the formula:

New Count = IF(HASONEVALUE(Table[District]), 
    [Count], 
    SUMX(
        ADDCOOLUMNS(
            SUMMARIZE(Table, [Country], [District]), "count measure", [Count]
        ), 
    [count measure])
)

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.