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 calculates the difference between a theoretical power and a real power. This measure works:

I would like to be able to count the number of times that this difference is less than or equal to the values that I have in my reference table which is below:

I also present my time-stamped table :

There is no link for the moment between these two tables.

Do you think this is possible?

 

Thank you in advance for your help,

Have a nice day

 

  • 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

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Yes, I think it's perfectly possible.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Anonymous 

      Great thanks, could you please explain how?

      Thanks in advance,

      Joel

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Anonymous 

      I would like to ask you again about my request, could you please explain the request to create in order to realize my calculation?

      Thank you in advance,

      Sincerely

      • PaulOlding's avatar
        PaulOlding
        Solution Sage

        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
    Not applicable
    // 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
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello Anonymous  and PaulOlding 

      Thank you for your generous help, have a nice day,

      Sincerely