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
Franki9
Frequent Visitor

Remove repetitive 0% and 100% out of graph

Hi,

 

The graph I am building is a timeline of progress for construction, I have combined weekly reports over years. So in short the data looks as follow:

DateProgressAreas
10 03 20170%AREA 1
17 03 20170%AREA 1
25 03 20170%AREA 1
12 04 201750%AREA 1
20 04 2017100%AREA 1
25 04 2017100%AREA 1
10 05 2017100%AREA 1

 

Im struggling to remove all the unesarry 0% and 100% from my graph, there should 1 off each and the rest should be removed from the calculation. See my calculation I have made the doesnt seem to work, please help.



Franki9_0-1652085782017.png

 

Erected Final =
var Finish_date = CALCULATE(MIN('CALENDAR'[Date]),FILTER('Unit 2 - 6 - 21 Mar 2017+', 'Unit 2 - 6 - 21 Mar 2017+'[ERECT / LEVEL & SECURE] = 1.00))
var Start_Date = CALCULATE(MAX('CALENDAR'[Date]), FILTER('Unit 2 - 6 - 21 Mar 2017+', 'Unit 2 - 6 - 21 Mar 2017+'[ERECT / LEVEL & SECURE] = 0.00))

return
 
CALCULATE(SUM('Unit 2 - 6 - 21 Mar 2017+'[ERECT / LEVEL & SECURE]),
FILTER('CALENDAR','CALENDAR'[Date] >= Start_Date
&& 'CALENDAR'[Date] <= Finish_date)

)



Kind Regards,
Frank 

2 REPLIES 2
Anonymous
Not applicable

Hi Frank,

 

Please try this measure.

Erected Final = 
VAR _Finish_date =
    CALCULATE (
        MIN ( 'Unit 2 - 6 - 21 Mar 2017+'[Date] ),
        FILTER (
            ALL('Unit 2 - 6 - 21 Mar 2017+'),
            'Unit 2 - 6 - 21 Mar 2017+'[ERECT / LEVEL & SECURE] = 1.00
        )
    )
VAR _Start_Date =
    CALCULATE (
        MAX( 'Unit 2 - 6 - 21 Mar 2017+'[Date] ),
        FILTER (
            ALL('Unit 2 - 6 - 21 Mar 2017+'),
            'Unit 2 - 6 - 21 Mar 2017+'[ERECT / LEVEL & SECURE] = 0.00
        )
    )
RETURN
    CALCULATE (
        SUM ( 'Unit 2 - 6 - 21 Mar 2017+'[ERECT / LEVEL & SECURE] ),
        FILTER (
            'CALENDAR',
            'CALENDAR'[Date] >= _Start_Date
                && 'CALENDAR'[Date] <= _Finish_date
        )
    )

vcgaomsft_0-1652323357944.png

Attached PBIX file for reference.

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Hi Gao,

Thanks so much for coming back to me, the calculation isnt working as I think it is due to the additional data and filters added the calculation should look at the columns filtered. See below the sample data and my current results, thanks again for your help.

Sample Data

DateAreaArea NumberBoilerMass/qtyMass/Qty ErectedErected %Type
16 Jan 2017CAC2Structural Boiler 216849.700Structural
16 Jan 2017CAC3Structural Boiler 316849.700Structural
16 Jan 2017CAC4Structural Boiler 416845.200Structural
16 Jan 2017CAC5Structural Boiler 516845.200Structural
16 Jan 2017CAC6Structural Boiler 616845.200Structural
16 Jan 2017SILO2Structural Boiler 4126723.700Structural
16 Jan 2017SILO2Structural Boiler 4815.800Structural
16 Jan 2017T2DStructural Boiler 420134.500Structural
16 Jan 2017T2EStructural Boiler 420134.500Structural
16 Jan 2017T2FStructural Boiler 420134.500Structural
16 Jan 2017T3DStructural Boiler 459983.100Structural
16 Jan 2017T3DTake-Up & Drive Sheeting Structure Boiler 418175.500Structural
16 Jan 2017T3E Drive Area Sheeting Structure Boiler 412064.700Structural
16 Jan 2017T3EStructural Boiler 44065400Structural
16 Jan 2017T3FStructural Boiler 440305.700Structural
16 Jan 2017T4AStructural Boiler 247842.914690.30.307053Structural
16 Jan 2017T4AStructural Boiler 347203.800Structural
16 Jan 2017T4BStructural Boiler 223933.87149.20.298707Structural
16 Jan 2017T4BStructural Boiler 323636.900Structural
16 Jan 2017T4CStructural Boiler 221039.67075.30.336285Structural
16 Jan 2017T4CStructural Boiler 320741.200Structural


As you can see below I have multiple filters as from table above.

Franki9_1-1652339766527.png


Below is the calculation I took from you and abused it probably, but I believe the problem is with the calculation filter that Im missing. 

Erected 2 = 
VAR _Finish_date =
    CALCULATE (
        MIN ( 'STR-PLT-MEC'[Date] ),
        FILTER (
            'STR-PLT-MEC',
            'STR-PLT-MEC'[Mass/Qty Erected] = 'STR-PLT-MEC'[Mass/qty]
        )
    )
VAR _Start_Date =
    CALCULATE (
        MAX( 'STR-PLT-MEC'[Date] ),
        FILTER (
            'STR-PLT-MEC',
            'STR-PLT-MEC'[Mass/Qty Erected] = 0.00
        )
    )

RETURN
        CALCULATE(
            DIVIDE(CALCULATE(SUM('STR-PLT-MEC'[Mass/Qty Erected])),           
            CALCULATE( SUM('STR-PLT-MEC'[Mass/qty]))),
        FILTER(
                'CALENDAR',
                'CALENDAR'[Date] >= _Start_Date
                    && 'CALENDAR'[Date]<= _Finish_date
        )
        )

 

 

 

Kind Regards,
Frank

 

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.