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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

Calculate dynamic line for plotting on a line and clustered bar chart

Hi All,

 

I have a many tables and relationships, but to summarize my problem

 

I have a table like below - 

 

ObjectDateCt
AJan-15
AJan-210
AJan-315
AJan-420
BJan-11
BJan-22
BJan-33

 

I have created a simple measure to get the percentage of count for the object - 

 

 

pc_ct = 

var ct_obj = CALCULATE(SUM(Table1[Ct]))

var ct_total_obj = CALCULATE(SUM(Table1[Ct]), REMOVEFILTERS(Table1[Object]))

return ct_obj/ct_total_obj

 

 

And plotted a clustered column chart and added a constant line at 5% using the "Analytics" pane of the visual.

kmpbi_1-1633475670240.png

My goal is to make that constant line dynamic. The logic is :

the constant threshold line should be = to the minimum % value on the bar chart as long its greater than 5%, else should default to 5%.

For example -

in this chart, it should show at 11%. 

As another example,
If the % ct is say 3%, the constant threshold line should show 5%

 

In my original data, I have many objects and many filters to slice the data.
I am happy to switch to a line and cluster column chart visual, but I am not sure how to write the DAX measure to get that dynamic constant line.

 

Any help in this regard would be highly appriciated.

regards

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , based on what I got , create a measure and use that in constant line (with new fx option in new release)

 

measure = minx(Values(Table[object]), [pc_ct])

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , based on what I got , create a measure and use that in constant line (with new fx option in new release)

 

measure = minx(Values(Table[object]), [pc_ct])

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.