Reply
NW953
Frequent Visitor
Partially syndicated - Outbound

Need help with Sum of the lowest cost option

I have 4  DAX measures that calculate the cost for that option for each user. Lets call them License1, License2, License3, License4

 

They all work correctly and sum for all users, etc.

 

I need to calculate what the lowest cost option is for each user (email), then also have a columm total that is the SUM of the lowest cost option for each user. I used SWITCH to return the lowest cost option and it works, but does not sum.... I am not tied to using SWITCH though

 

Thanks for your help in advance

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

Syndicated - Outbound

I'm going to assume that you have some kinda table with a column for all the users.

If so, then something like the following might work:

Total Min Cost = 
var minCostPerUser = ADDCOLUMNS(VALUES(UserTable[UserEmail]), 
    "minCost", CALCULATE(MIN(MIN(MIN([License1],[License2]),[License3]),[License4]))
)
RETURN SUMX(minCostPerUser, "minCost")

 

You can post a sample of your data (i.e create a table) and someone else can tag in if my solution isn't what you're looking for

vicky__0-1719961135094.png

 

View solution in original post

1 REPLY 1
vicky_
Super User
Super User

Syndicated - Outbound

I'm going to assume that you have some kinda table with a column for all the users.

If so, then something like the following might work:

Total Min Cost = 
var minCostPerUser = ADDCOLUMNS(VALUES(UserTable[UserEmail]), 
    "minCost", CALCULATE(MIN(MIN(MIN([License1],[License2]),[License3]),[License4]))
)
RETURN SUMX(minCostPerUser, "minCost")

 

You can post a sample of your data (i.e create a table) and someone else can tag in if my solution isn't what you're looking for

vicky__0-1719961135094.png

 

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)