Forum Discussion

msalamon's avatar
msalamon
Icon for Helper I rankHelper I
6 years ago
Solved

Date slider with a Map

I'm trying to determine how to create a report that does the following.

 

My data is very simple and is composed of 3 columns:

  • State name
  • Rating.  A value from a small set of available values.  Think:  Low, Medium and High.
  • Date. The date is likely not every day but a date per month or date per week, like Jan 1, 2020, Feb 1, 2020, etc.

Assume that there is an entry for every combination of state-rating-date within a given date range, like every month in a given year.

I want to display this using a map of the United States where the legend is based on Rating.  For example, Low = Red, Medium = Yellow and High = Green, and the map would show each state with the appropriate color.  

Last, I want to add a single-value slider based on the Date, with a minimum value of the first date and a maximum value of the last date.  It would default to the most recent date.  That means when the report first appears, it would show the state-rating values in the map where the date = max(date).  Then I can use the slider to view the state-rating values for any specific date in the date range.. It would be very dynamic, so as I moved the slider the colors of the map would change accordingly to match the value of the selected date.

  • Hi msalamon ,

    You can only click the single date and it will select this date in timeline visual without dragging to select a rangle between dates.

     

    Best Regards,
    Yingjie Li

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

4 Replies

  • v-yingjl's avatar
    v-yingjl
    Icon for Community Support rankCommunity Support

    Hi msalamon ,

    Maybe you can follow these ways to try:

    1. Set the Rating fields as the Legend in the map

    2. Adjust three types of rating colors as 'Low-Red', 'Medium-Yellow', 'High-Green'

     

    3. Use the 'Timeline 2.1.1' visual which can be import from visual market, put the data field in this visual and enable 'Latest available period' under 'Force Selection' menu.

    4. The map and the timeline will show the latest state rating by default and you can drag the slider to change the timeline:

    Before enable 'Latest available period'After enable 'Latest available period'

    Best Regards,
    Yingjie Li

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

     

    • msalamon's avatar
      msalamon
      Icon for Helper I rankHelper I

      v-yingjl 

       

      Thanks for your response.

       

      With Timeline, is there any way to restrict it to a single date instead of a range?  In my testing, when using Timeline, it's very easy to use it to create a range, but I only want a single data to be selected at one time.

      • v-yingjl's avatar
        v-yingjl
        Icon for Community Support rankCommunity Support

        Hi msalamon ,

        You can only click the single date and it will select this date in timeline visual without dragging to select a rangle between dates.

         

        Best Regards,
        Yingjie Li

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

  • msalamon , You can create a date table , state table and have formula like

    Rating = CALCULATE(max(Table[Rating]),filter(Date,Date[Date]=max(Date[Date]))

     

    On top of this, you can either do conditional formatting or create a color measure and do conditional formatting

    https://radacad.com/dax-and-conditional-formatting-better-together-find-the-biggest-and-smallest-numbers-in-the-column

    https://docs.microsoft.com/en-us/power-bi/desktop-conditional-table-formatting#color-by-color-values