Forum Discussion

jobf's avatar
jobf
Icon for Helper II rankHelper II
7 months ago
Solved

Measure that shows whether the process has been completed

Observe the table with the data below:

PlotDateTypeProcessed AreaTotal Area
P12025/01/01A12.123
P12025/01/02A10.923
P22025/01/02A10.120
P22025/01/03A9.820
P22025/01/01B10.215

 

The Processed Area column represents the area that was processed on that day in that specific plot with that specific type. The Total Area column is the total area of ​​that specific plot with the specific type.
I need a measure that, in a table visual, looks like this:

PlotFirst DateTypeSituationSum of the processed areaTotal Area
P12025/01/01AProcessed2323
P22025/01/02AProcessing19.920
P22025/01/01BProcessing10.215

 

I need a "Situation" measure that shows whether a specific type in a specific plot has been fully processed. This can't be done directly in the table visual because I'm going to put it in a public link, and for some reason, it doesn't work there.

  • jobf I believe that a situation measure like that would look similar to the following:

    Situation Measure =
    VAR _ProcessedArea = SUM( 'Table'[Processed Area] )
    VAR _TotalArea = MAX( 'Table'[Total Area] )
    VAR _Return = IF( _ProcessedArea = _TotalArea, 1, 0 )
    RETURN _Return
  • I assume you only have Fact table instead using a star-schema here. If so please try using the measures below in your visual:

    First Date =
    CALCULATE (
        MIN ( 'Data'[Date] ),
        ALLEXCEPT ( 'Data', 'Data'[Plot], 'Data'[Type] )
    )
    
    Processed Area (Sum) :+=
    CALCULATE (
        SUM ( 'Data'[Processed Area] ),
        ALLEXCEPT ( 'Data', 'Data'[Plot], 'Data'[Type] )
    )
    
    Total Area (Group) =
    CALCULATE (
        MAX ( 'Data'[Total Area] ),
        ALLEXCEPT ( 'Data', 'Data'[Plot], 'Data'[Type] )
    )
    
    Situation =
    VAR Proc = [Processed Area (Sum)]
    VAR Tot  = [Total Area (Group)]
    RETURN
    IF (
        NOT ISBLANK ( Tot ) && Proc >= Tot, 
        "Processed",
        "Processing"
    )
    

     

    Visual:

    • Fact[Plot]
    • [First Date]
    • Fact[Type]
    • [Situation]
    • [Processed Area(Sum)]
    • [Total Area]

6 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi jobf 

      Hope everything’s going smoothly on your end. I wanted to check if the issue got sorted. if you have any other issues please reach community.

       

  • jobf I believe that a situation measure like that would look similar to the following:

    Situation Measure =
    VAR _ProcessedArea = SUM( 'Table'[Processed Area] )
    VAR _TotalArea = MAX( 'Table'[Total Area] )
    VAR _Return = IF( _ProcessedArea = _TotalArea, 1, 0 )
    RETURN _Return
  • I assume you only have Fact table instead using a star-schema here. If so please try using the measures below in your visual:

    First Date =
    CALCULATE (
        MIN ( 'Data'[Date] ),
        ALLEXCEPT ( 'Data', 'Data'[Plot], 'Data'[Type] )
    )
    
    Processed Area (Sum) :+=
    CALCULATE (
        SUM ( 'Data'[Processed Area] ),
        ALLEXCEPT ( 'Data', 'Data'[Plot], 'Data'[Type] )
    )
    
    Total Area (Group) =
    CALCULATE (
        MAX ( 'Data'[Total Area] ),
        ALLEXCEPT ( 'Data', 'Data'[Plot], 'Data'[Type] )
    )
    
    Situation =
    VAR Proc = [Processed Area (Sum)]
    VAR Tot  = [Total Area (Group)]
    RETURN
    IF (
        NOT ISBLANK ( Tot ) && Proc >= Tot, 
        "Processed",
        "Processing"
    )
    

     

    Visual:

    • Fact[Plot]
    • [First Date]
    • Fact[Type]
    • [Situation]
    • [Processed Area(Sum)]
    • [Total Area]
  • Hi,

    Write this measures

    PA = sum(Data[Processed area])

    TA = min(Data[Total area])

    Situation = if([PA]<[TA],"Processing","Processed")

    Hope this helps.

  • Hi jobf 

    Can you try this measure.

    Situation =
    VAR _Processed = SUM(data[Processed Area])
    VAR _Total = MAX(data[Total Area])
    RETURN IF (_Processed >= _Total, "Processed", "Processing")