Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Calculation between a data table and a reference table

Hello to all,   I am asking for your help concerning a measurement between two tables: A table that serves as a reference and a table of time-stamped data. I have created a measure that calculate...
  • PaulOlding's avatar
    PaulOlding
    5 years ago

    Hi.  Some example data in table form or a link to the .pbix would have been very useful.  Try this measure out.  I haven't been able to test it.

     

    Distribution Measure = 

    VAR _CurrentDistribution = SELECTEDVALUE('dim_distribution'[distribution])
    VAR _Result =
    COUNTROWS (
    FILTER (
    VALUES ( 'Table'[dt (1j)] ),
    [ecart_modelisation] <= _CurrentDistribution
    )
    )

    RETURN

    _Result

  • Anonymous's avatar
    Anonymous
    5 years ago
    // It's very simple.
    // Let's say you've put the
    // distribution column in
    // a slicer and you can
    // select only one option
    // at a time. Then this measure
    // would give you the
    // number of days (=times) where
    // the measure [ecart_modelisation]
    // is <= to the selected value/option.
    // If there is more than one option
    // visible in the current context,
    // BLANK is returned.
    
    [# Below or Equal] =
    var DistributionVal =
        SELECTEDVALUE(
            dim_distribution[distribution]
        )
    var Result = 
        IF( NOT ISBLANK( DistributionVal ),
            COUNTROWS(
                FILTER(
                    DISTINCT( fact_points_mesure[dt(1j)] ),
                    [ecart_modelisation] <= DistributionVal
                )
            )
        )
    return
        Result