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! Request now

Reply
Anonymous
Not applicable

Calculation problem

Hello,
 
I am having the below mentioned formula.
 
 
FrameContractGrouping = IF([InvoiceUsage]<=0,1;"0-10%";
IF(AND([InvoiceUsage]<=0,2;[InvoiceUsage]>0,1);"10-20%";
IF(AND([InvoiceUsage]<=0,3;[InvoiceUsage]>0,2);"20-30%";
IF(AND([InvoiceUsage]<=0,4;[InvoiceUsage]>0,3);"30-40%";
IF(AND([InvoiceUsage]<=0,5;[InvoiceUsage]>0,4);"40-50%";
IF(AND([InvoiceUsage]<=0,6;[InvoiceUsage]>0,5);"50-60%";
IF(AND([InvoiceUsage]<=0,7;[InvoiceUsage]>0,6);"60-70%";
IF(AND([InvoiceUsage]<=0,8;[InvoiceUsage]>0,7);"70-80%";
IF(AND([InvoiceUsage]<=0,9;[InvoiceUsage]>0,8);"80-90%";
IF(AND([InvoiceUsage]<=1;[InvoiceUsage]>0,9);"90-100%";
IF(AND([InvoiceUsage]<=2;[InvoiceUsage]>1);"100-200%";
IF([InvoiceUsage]>2;"over 200%"))))))))))))
 
 
Unfortunately, it is not working properly because if choose one of the groups. For example - "40-50%" it is showing rows that are out of the scope of this filter. 
PowerBiCalculationProblem
 
 
4 REPLIES 4
Anonymous
Not applicable

PowerBiCalculation.PNG

Anonymous
Not applicable

Hi @Anonymous ,

It seems like that contract has multiple records with same category range, so its usage records has been summarized on your visual.(notice: category column not effect your filter, I haven't found you use all/all excel functions to ignore current filter)

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

@Anonymous 

Can you be more specific as this general info for sure is not helping me... How come that my calculation is working and then the grouping based on the same calculation is totally wrong. What exactly I need to do in order the column "FrameContractGrouping" to have the proper group ....

 

 

1.png

Anonymous
Not applicable

HI @Anonymous ,

You can try to use following calculated column to convert invoice usage as group:

FrameContractGrouping =
IF (
    [InvoiceUsage] > 2;
    "over 200%";
    IF (
        AND ( [InvoiceUsage] <= 2; [InvoiceUsage] > 1 );
        "100-200%";
        IF (
            AND ( [InvoiceUsage] <= 1; [InvoiceUsage] > 0,9 );
            "90-100%";
            ROUNDDOWN ( [InvoiceUsage]; 1 ) * 100 & "-"
                & ( ROUNDDOWN ( [InvoiceUsage]; 1 ) + 0,1 ) * 100 & "%"
        )
    )
)

What type of 'invoice Usage' field you used? column or measure? Current you can't create a dynamic calculated column based on slicer/filter or dynamic measure.

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors