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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register 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
Solution Sage
Solution Sage

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

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.