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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Calculating the sum of a measure

Hi 

Hope all is well

 

I am tryting to calcuate a sum of a measure . Is there way that you can treat a mesure like a column and reference it within your sum function for example 

 

Measure 2 = Sum('Logs Usage'[username]) + 0,  instead of calling username column I would like to reference a existing measure I calculated called countusername . 
 
 
image (9).png
 
 

 

Any Help will be greatly appreciated

 

Cheers!!

 

 

 

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Try:

SUMX( VALUES( 'Logs Usage'[username] )  ,[countusername]))

If the problem persists,could you share the sample pbix via cloud service like onedrive for business?

Please mask any sensitive data before uploading

 

Best Regards,
Liang
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

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous ,

Not very clear. Try

sumx(Table,[measure])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks for the @amitchandak  sorry for being not to clear I am quite new to this. I tired the above   So I want to be able to show zero values aswell . The reason behind this I have a username with n coulmn which I have created a measure that calcuates the distinct users in a company that were active within a timeframe and groups it by compnay name. The issue I had was if I was to directly create a sum function based on the username column it will give this error :

andrew-26_0-1600845182725.png

 

That would have been the easiest way , my ideal goal is show compaies with zero active users aswell as the active users. As shown below that is what I want but also in the matrix table to show zero if users were not active within a timeframe. Really sorry if that made no sense . 

 

 

andrew-26_1-1600845320112.png

 

Hi @Anonymous ,

 

Try:

SUMX( VALUES( 'Logs Usage'[username] )  ,[countusername]))

If the problem persists,could you share the sample pbix via cloud service like onedrive for business?

Please mask any sensitive data before uploading

 

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

Anonymous
Not applicable

@V-lianl-msft Thanks for that that worked , only issue I have now is getting the zero values to appear . Is there a way I can get this logic to work like the same as this logic 

Sum('Updates Made'[Updates]) + 0 - this shows all updates made by companies aswell as instances when companies have made zero updates . Is there a way to add this logic to this formula, to show when companies had zero active users  - SUMX( VALUES( 'Logs Usage'[username] )  ,[countusername])). 
 
Thanks for the help thus far !!

Hi @Anonymous ,

 

Sorry for the late reply

Try

var test =  SUMX( VALUES( 'Logs Usage'[username] )  ,[countusername]))
return if(isblank(test),0,test)

 

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

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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