Forum Discussion

MPrex's avatar
MPrex
Regular Visitor
1 year ago
Solved

Scatterchart with TimeSeries Data and Field

My dataset has 5 columns: Time, T1, T2 (temperatures), P1 and P2 (pressures).

Time is a datatype Date/Time, while the others are decimals.

I would like to plot T1, T2, P1 and P2 on y axis and Time on x axis. 

From Modeling -> New Parameters -> Fields, I have created "X Parameters". This way I can select which one I want to plot in the report without having 4 different graphs.

 

 

I am trying to create a scatter plot but I get this error:

Does any of you have any idea of what I am missing? Is there anything wrong?

Thanks for the help! 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi MPrex ,
    According to your error message, you can dynamically display the data on the x-axis by creating a MEASURE using the aggregate function.

    P1 Measure = SUM('Table'[P1])

    Final output

     

    Best regards,
    Albert He


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi MPrex ,
    According to your error message, you can dynamically display the data on the x-axis by creating a MEASURE using the aggregate function.

    P1 Measure = SUM('Table'[P1])

    Final output

     

    Best regards,
    Albert He


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

    • MPrex's avatar
      MPrex
      Regular Visitor

      Hi Anonymous 

      Your solution works. 
      Since in reality I have 100+ columns, I was wondering if I need to do this procedure "manually" for all of them. Is there a faster way?

      Thanks!

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi MPrex ,
        Batch creation of MEASURES with the same structure is not possible in the current version of power bi desktop. The fastest way is to create it manually and it is also better to use it in parameters. You can create as many measures as you need, which will reduce the number of measures you need to create.

         

        Best regards,
        Albert He


        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

  • timalbers's avatar
    timalbers
    Skilled Sharer

    Hi MPrex ,

    just to make sure, what is the data type of the "Time" field?

    It has to be numeric or a date hierarchy - otherwise it won't work as a x-axis property.

  • MPrex's avatar
    MPrex
    Regular Visitor

    Hi timalbers !

    Time is a Date/Time value. It is store in format YYYY-MM-DD HH:MM:SS 

    The resolution of the dataset is 30 seconds: 2025-01-12 13:00:00, 2025-01-12 13:00:30 and so on.

    I didn't select date hierarchy since there is no hour / minute resolution.