Forum Discussion

zibster's avatar
zibster
Helper III
6 years ago
Solved

Dynamic Reference Lines on X-Axis

Hi,

 

I have a question how can i change the DAX below to display multiple reference lines on a line and clustered column chart?

the example is from great youtube video

Power BI - Dynamic Reference Line on X-Axis

But it is only for one reference line

Thanks Z

 

 

 

InvDate =

var virtual =

   

        SUMMARIZE(ALLSELECTED(FMT),

        FMT[WE-DATE-3],

            "EINV", sum (FMT[END-INV])

            )

Return

    IF(

        MAX(FMT[WE-DATE-3]) = MAX(InventoryDT[WeekEnd]),

        MAXX(virtual,[EINV]),BLANK()

    )

5 Replies

  • rajulshah's avatar
    rajulshah
    Resident Rockstar

    Hello zibster,

     

    Is the DAX query provided a calculated measure?

    Please note that a calculated measure will always return a single value. If you provide some more details as to what values you need to plot as dynamic reference lines, maybe I could help you in a better way.

    • zibster's avatar
      zibster
      Helper III

      Hi,

      I would like to plot the inventory dates on the chart, the inventory chart is reference as InventoryDT[WeekEnd], these are weekend dates. The data table has calculated inventory levels on weekly basis and the weekend dates for each of the weeks. Within last 52 weeks the facility I am working on  completed actual inventory 2 times but other facility the inventory was done 3 of 4 times. Please let me know if this make sense.

       

       

      Thanks for Your help

      • zibster's avatar
        zibster
        Helper III

        one more thing InventoryDT[WeekEnd] is a calculated column returning weekend dates 

        WeekEnd = InventoryDT[INVENTORY_DATE] - WEEKDAY(InventoryDT[INVENTORY_DATE],1)+7
    • zibster's avatar
      zibster
      Helper III

      Perfect 🙂 Thanks For Your help.