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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
MrLube
New Member

determining percent range from two column totals.

I have three product streams that I am spending on (Actuals column)

I have a column that indicates the Plan of spending (Plan column)

New data is entered after the previsous months bills are tallied for each stream.

I need to determine if the "Actual" spending total is within a 10% (+/-5%) of plan.

I am looking for a result of 1 or 0

 

My totals for each have been derived from a measure using VAR.

 

PowerBI is not allowing me to create a measure that includes SUM when it is not a column, therefore I cannot use the below expression.

 

SAMPLE DATA:  using equation =IF(AND(SUM(D22/C22)>=0.95,SUM(D22/C22)<=1.05),"1","0")

 ABCDEF
1MonthProduct Stream Plan  Actuals   
22/1/2022Water Based $   14,619,362.99 $     6,424,296.78  
32/1/2022Air Based $   14,249,594.37 $   15,855,890.04  
42/1/2022Solar Based $   13,338,123.99 $     5,896,612.58  
53/1/2022Water Based $   15,993,096.00 $   14,591,524.23  
63/1/2022Air Based $   13,088,130.22 $   13,363,313.64  
73/1/2022Solar Based $     9,948,330.84 $   16,668,038.00  
89/1/2022Solar Based $   16,649,343.56 $   19,476,394.30  
910/1/2022Water Based $     6,013,898.25 $     6,150,882.42  
1010/1/2022Air Based $     9,114,130.67 $   14,770,344.48  
1110/1/2022Solar Based $   13,856,225.44 $     4,541,430.10  
1211/1/2022Water Based $     4,623,342.56 $     8,355,904.00  
1311/1/2022Air Based $   10,585,451.49 $     9,948,330.84  
1411/1/2022Solar Based $   14,770,344.48 $   16,649,343.56  
1512/1/2022Water Based $     4,541,430.10 $     5,896,612.58  
1612/1/2022Air Based $     8,355,904.00 $     6,150,882.42  
1712/1/2022Solar Based $   14,834,497.47 $   13,338,123.99  
181/1/2023Water Based  $                         -    
191/1/2023Air Based  $                         -    
201/1/2023Solar Based  $                         -    
21     outcome
22   $ 184,581,206.43 $ 178,077,923.96 1

the goal is to have a score card look similar to this:

MrLube_0-1678733894328.png

the outcome of a 1 or 0 will allow me to create a pie chart with a measure depicting green or red based on 1 or 0.

 

Any help with this score card and expression or percentage range would be great.

 

1 ACCEPTED SOLUTION
bharath_v
Resolver I
Resolver I

To determine if the "Actual" spending total is within a 10% (+/-5%) of plan, you can follow these steps:

  1. Create a new column to calculate the percentage difference between the actual spending and plan spending for each product stream using the following DAX formula:

     
    % Difference = ABS('Table'[Actuals] - 'Table'[Plan]) / 'Table'[Plan]

    This formula calculates the absolute percentage difference between the actual and plan spending for each product stream.

  2. Create a new column to check if the % difference is within the 10% (+/-5%) range using the following DAX formula:

     
    Within Range = IF( 'Table'[% Difference] <= 0.1 && 'Table'[% Difference] >= 0.05, "1", "0" )

    This formula checks returns 1 (Within Range) if it is, or 0 (Outside Range) if it isn't.

Hope this helps.

 

If I answered your question then pls mark my post as "Accept it as the solution" and a kudo would be appreciated.

View solution in original post

1 REPLY 1
bharath_v
Resolver I
Resolver I

To determine if the "Actual" spending total is within a 10% (+/-5%) of plan, you can follow these steps:

  1. Create a new column to calculate the percentage difference between the actual spending and plan spending for each product stream using the following DAX formula:

     
    % Difference = ABS('Table'[Actuals] - 'Table'[Plan]) / 'Table'[Plan]

    This formula calculates the absolute percentage difference between the actual and plan spending for each product stream.

  2. Create a new column to check if the % difference is within the 10% (+/-5%) range using the following DAX formula:

     
    Within Range = IF( 'Table'[% Difference] <= 0.1 && 'Table'[% Difference] >= 0.05, "1", "0" )

    This formula checks returns 1 (Within Range) if it is, or 0 (Outside Range) if it isn't.

Hope this helps.

 

If I answered your question then pls mark my post as "Accept it as the solution" and a kudo would be appreciated.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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