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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.