Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Display descrete values above line

I have a table which contains daily sales:

  • a column containing sales
  • a column containing unique dates (yyyy-mm-dd)

 

I ranked it by selected time slot and I took the highest ones:

 

MaxSales := 
VAR SalesRank =
    RANKX ( ALLSELECTED ( DailySales ); [SalesAmount] )

RETURN
    IF ( SalesRank = 1; DailySales[SalesAmount] )

 

 

 

I have a line chart that displays monthly sales

I want to display the months where the best daily sales was. For instance, from January to July, the best daily sales was 40, on February 23; then the result would be a dot (or a bar) displayed on February, above the line:

Because the time granularity is not the same for the line (monthly) and the dot (daily), I am not able to create this graph.

How is it posible to achieve this?

  • dax's avatar
    dax
    6 years ago

    Hi Grop, 

    You could refer to my sample to see whether it work or not.

    Best Regards,
    Zoe Zhi

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

     

3 Replies

  • dax's avatar
    dax
    Icon for Community Support rankCommunity Support

    Hi Grob,

    You could try to refer to my sample, create Y-M column(column2), then set column2 sort by column1. And use below measure it should work.

    Best Regards,
    Zoe Zhi

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

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you for your answer, it does partially solve the problem.

       

      But as you can see, in your report, MaxSales shows 21 in June. My question is how to make it display 20, which is the amount of June 5 and the maximum for all the dates in the table.

      To come back to my example, I want MaxSales to show 40 and not 3,6k (which is the sum of all sales in the month).

       

      Maybe I have to modify the way I calculated MaxSales.

      If yes, then how can I write a measure that fits my requirements?

      • dax's avatar
        dax
        Icon for Community Support rankCommunity Support

        Hi Grop, 

        You could refer to my sample to see whether it work or not.

        Best Regards,
        Zoe Zhi

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