Forum Discussion

lushd's avatar
lushd
Frequent Visitor
5 years ago
Solved

Multi variable scatter plot

Hi Community,   I have a dataset of shipping voyages with columns for Date, Port, Shipping company, loading time, discharge time, etc.  One useful visual is a scatterplot with loading time and dis...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi lushd ,

     

    Please try the following steps:

     

    1. Createa a new table with Legend type (Port and Company) for slicer.

    2. For dynamic Y-axis:

    Measure = 
    SWITCH(MAX('ForSlicer'[Legend]),
    "Port",CALCULATE(MAX('Table'[discharge time]),FILTER('Table','Table'[Port]=MAX('Table'[Port]))) ,
    "Company", CALCULATE(MAX('Table'[discharge time]),FILTER('Table','Table'[Company]=MAX('Table'[Company]))))

    3. Create a rank measure for conditional formatting:

    For conitional formatting = 
    SWITCH(MAX('ForSlicer'[Legend]),
    "Port",RANKX(ALL('Table'), CALCULATE ( MAX ( ( 'Table'[Port]) ) ),,ASC,Dense) , 
    "Company", RANKX(ALL('Table'), CALCULATE ( MAX ( ( 'Table'[Company]) ) ),,ASC,Dense))

    4. Add Port and Company to tooltips field.

    Or unpivot the table.

    https://community.powerbi.com/t5/Desktop/Custom-Visualisation-for-multiple-legends-and-values/td-p/645218

     

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