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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mdm2025
Frequent Visitor

Custom Reference Line Using DAX

Hello everyone, 

 

I wanted to check if anyone has found a workaround for setting up a custom calculated reference line in Power BI.

While the default reference line options are useful and make sense in many scenarios, I would like to use a custom DAX measure instead. Unfortunately, Power BI currently doesn’t seem to support this directly.

To clarify what I’m aiming for:
I’d like to display a custom calculated line for each column in a column chart. If that’s not possible for multiple columns, is there at least a way to achieve this for a visual with a single column?

 

I’ve included an example below to illustrate the goal more clearly.

mdm2025_0-1753783178214.png
Currently I am using a column insted of the line but doesn't look that great. 

mdm2025_2-1753783289171.png


Thanks in advance for any ideas or suggestions!

Best,

Marius

8 REPLIES 8
mdm2025
Frequent Visitor

Hello everyone, 

Thank you for your prompt reply on this. 

I am not looking for the combo chart option as doesn't meet the visual requirements. The goal is to apply a individual line calculated on a custom measure for each of the columns. That is why I am using another column at the moment in lack of something similar. 
I will share a pbi example file once I put one together which will hopefully clarify the intent. 

 

Thank you,

Marius

v-hjannapu
Community Support
Community Support

Hi @mdm2025,

I would also take a moment to thank @jaineshp @wardy912  for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

Best Regards,
Harshitha.

Hi @mdm2025,
I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We are always here to support you.

Regards,
Harshitha.

Hey @v-hjannapu,

Really appreaicte your recognization.

Hey @v-hjannapu,

Really appreaicte your recognization.

techies
Super User
Super User

Hi @mdm2025 can you please share pbix file so that I can understand what's going on

 

 

― Power BI | Microsoft Fabric | PL-300 | DP-600 | Blog: medium.com/@cseprs_54978
jaineshp
Skilled Sharer
Skilled Sharer

Hi ,

To create per-category reference lines, use a Line and clustered column chart plus a custom DAX measure. First, define a measure that returns the desired “target” for each category (e.g. day of week) using SWITCH and SELECTEDVALUE. For example, if your axis is the day of the week, you could write:

Custom Reference Line =
SWITCH(
SELECTEDVALUE('Date'[Day Name]),
"Monday", 1500,
"Tuesday", 1300,
"Wednesday", 500,
"Thursday", 1200,
"Friday", 900,
"Saturday", 800,
"Sunday", 700,
BLANK()
)

@mdm2025

wardy912
Responsive Resident
Responsive Resident

Hi @mdm2025 

 

 You will need to create a measure similar to the below, I am setting different targets for different days of the week.

 

Custom Reference Line = 
SWITCH(
    SELECTEDVALUE('Date'[Day Name]),
    "Monday", 1500,
    "Tuesday", 1300,
    "Wednesday", 500,
    "Thursday", 1200,
    "Friday", 900,
    "Saturday", 800,
    "Sunday", 700,
    BLANK()
)

 

Add that as the line y-axis in a line and clustered column chart for the following result

 

wardy912_0-1753784532765.png

You could also add it as a tooltip for better visibility

 

wardy912_1-1753784620168.png

 

I hope this helps! Please give a thumbs up and mark as solved if it does, thanks!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.