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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Sania-F
Resolver I
Resolver I

VALUES function with HASONEVALUE and SUMX iterator function

sales commission iterator =
SUMX(
    VALUES('Sales Territory'[Region]),
    CALCULATE(
        [Revenue]
        * IF(
            VALUES('Sales Territory'[Country]) = "United States",
            0.15,
            0.1
        )
    )
)
----------------------------------------------------------------------------------
sales commission = [Revenue] *
if(HASONEVALUE('Sales Territory'[Country]),
 IF(VALUES('Sales Territory'[Country]) = "United States", 0.15,0.1))
-----------------------------------------------------------------------------------
  • Iterator version = correct when multiple values exist, because it loops through each row and applies the right logic.

  • Simple version = works only when the filter context guarantees one country at a time. If multiple exist, it miscalculates.


  • In sales commission iterator, SUMX iterates through each region, evaluates [Revenue] * 0.1, then sums up.

  • In sales commission, you’re multiplying the total [Revenue] in context by 0.1.


Rule of thumb:

  • Use simple measure if your business rule applies a single rate per filter context.

  • Use iterator (SUMX) when you need row-by-row logic, e.g., different commission rates for different countries/products.

2 REPLIES 2
v-sdhruv
Community Support
Community Support

Hi  @Sania-F ,
Thank you for sharing this. This kind of post is incredibly valuable to the community. Consider turning this into a blog post so others can benefit from your experience more easily
Power BI Community Blog - Microsoft Fabric Community


Thank You!

FBergamaschi
Super User
Super User

This is a blog for asking for support, if you want to explain DAX you can consider other blogs

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

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