Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
zibster
Helper III
Helper III

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

Capture.PNG

 

 

 

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()

    )

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@zibster 

 

You may use the IN operator.

    IF (
        MAX ( FMT[WE-DATE-3] ) IN VALUES ( InventoryDT[WeekEnd] ),

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-chuncz-msft
Community Support
Community Support

@zibster 

 

You may use the IN operator.

    IF (
        MAX ( FMT[WE-DATE-3] ) IN VALUES ( InventoryDT[WeekEnd] ),

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Perfect 🙂 Thanks For Your help.

rajulshah
Resident Rockstar
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.

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

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

WeekEnd = InventoryDT[INVENTORY_DATE] - WEEKDAY(InventoryDT[INVENTORY_DATE],1)+7

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors