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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
sharpedogs
Advocate II
Advocate II

SUM(X) and RoundUp -- maybe??

Hi, 

I've been trying all kinds of tricks but I can't seem to get the correct output i need..

 

I'm trying to fingure out how many licenses my team requires for a product. 

The license rule is that a single user can deply the Software on only 2 devices, if a user deploys it on more devices they need to purchase additional licesnes

1 or 2 devices = 1 licesne

3 or 4 deivces = 2 licesnes

5 or 6 devices = 3 licenses 

 

I took the devices and did a Distintcount[DeviceName], then i put it in a matrix next to the user name. This tells me how many unique devices each user has. Then i created a Licesne Requirement =Distintcount[DeviceName]/2.  The output is below. 

 

The issue with the output is this, i need to round the Licenses Required up to the next whole number. For example, user Sam Licenses Required should read 3 not 2.5. 

 

The second issue I have is that when i use a DAX with round or SUMX i can never ger the total to add up correctly. 

 

UserDistinct DevicesLicenses RequiredWanted outcome
Sam52.53
Chad31.52
Dave211
Jeff10.51
Linda10.51
  68
1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

This expression seems to work with your example data.  Replace Licenses with your actual table name.

 

Licenses Needed =
SUMX (
VALUES ( Licenses[User] ),
CALCULATE ( ROUNDUP ( DISTINCTCOUNT ( Licenses[DeviceID] ) / 2, 0 ) )
)
 
or using your existing measure
Licenses Needed =
SUMX (
VALUES ( Licenses[User] ),
ROUNDUP ( [Distinct Devices] / 2, 0 ) )
)
 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
mahoneypat
Microsoft Employee
Microsoft Employee

This expression seems to work with your example data.  Replace Licenses with your actual table name.

 

Licenses Needed =
SUMX (
VALUES ( Licenses[User] ),
CALCULATE ( ROUNDUP ( DISTINCTCOUNT ( Licenses[DeviceID] ) / 2, 0 ) )
)
 
or using your existing measure
Licenses Needed =
SUMX (
VALUES ( Licenses[User] ),
ROUNDUP ( [Distinct Devices] / 2, 0 ) )
)
 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


amitchandak
Super User
Super User

@sharpedogs ,

you can use round([Licenses Required],0)

 

Check also these two functions

https://docs.microsoft.com/en-us/dax/rounddown-function-dax

https://docs.microsoft.com/en-us/dax/roundup-function-dax

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

I've used the round function as you noted and it works only to correctly round up the number to a whole number. There is also somehting going on in the backgroud with the Matrix as the Total does not reflect the actual number in the column. That' when i tired a sum X, but that didn't work either?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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