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
MiksLacis94
Frequent Visitor

Constant line in a scatter chart to be limited by DAX to assigned values only

Hello,

I have a scatter chart where my volume data is on the x axis and my weight data is on the y axis and I can set this to filter by box size. I have made a 2nd table that is linked to the fact table where I have set guideline values for what the max weight, min and max volume should be for each size of a box.
With DAX I made 3 guideline measures that I added as constant lines to the scatter chart to simulate a "box" where scattered dots inside the box are good and outside bad. My problem is that the constant lines don't just show up for the specific value length from the dimension table but rather extend all the way to the end of the chart. Is there any way to limit this via DAX?



MiksLacis94_0-1733147205894.png


I doubt that this is actually achievable but would be amazing if someone could help me with this.

Edit: I will take any solution that you believe would give me the desired result.

3 REPLIES 3
MiksLacis94
Frequent Visitor

So I attempted the solution myself and this is what I ended up with:

MiksLacis94_0-1733405469154.png

Clearly this is not quite it so I have created a test PBI file that I've uploaded to Dropbox, here is the link:

https://www.dropbox.com/scl/fi/fxtbyvasbb1kum36p50r2/Box_line_limit_problem_test.pbix?rlkey=12rel90k...

And well v-zhouwen-msft is quite on point regarding what I would like for it to look in the end.

MiksLacis94_1-1733405556299.png

 




Anonymous
Not applicable

Hi lbendlin ,thanks for the quick reply, I'll add more.

Hi @MiksLacis94 ,

Regarding your question, after my testing, it seems that it is not possible to truncate "constant lines" via DAX.

Agree with lbendlin , I added some additions to his solution.

The Table data is shown below:

Table:

vzhouwenmsft_0-1733209320321.png

Table 2 :

vzhouwenmsft_1-1733209333225.png

Use the following DAX expression to create a table

Table 3 = 
VAR _table1 = ADDCOLUMNS(SELECTCOLUMNS('Table',[Weight],[Volume]),"Column",1)
VAR _table2 = ADDCOLUMNS(GENERATESERIES(0,MAX('Table 2'[Max_Weight]),0.1),"Volumn",MAX('Table 2'[Min_Volumn]),"Column",2)
VAR _table3 = ADDCOLUMNS(GENERATESERIES(0,MAX('Table 2'[Max_Weight]),0.1),"Volumn",MAX('Table 2'[Max_Volumn]),"Column",2)
VAR _table4 = UNION(_table1,_table2,_table3)
VAR _table5 = SELECTCOLUMNS(_table4,[Volume],[Weight],[Column])
VAR _table6 = ADDCOLUMNS(GENERATESERIES(MAX('Table 2'[Min_Volumn]),MAX('Table 2'[Max_Volumn]),0.1),"Weight",MAX('Table 2'[Max_Weight]),"Column",2)
RETURN 
UNION(_table5,_table6)

Final output

vzhouwenmsft_2-1733209436780.png

 

Best Regards,
Wenbin Zhou

lbendlin
Super User
Super User

Instead of a dotted line you could have measures that would plot another set of dots which would happen to be in a different color and would happen to form a box.

 

Worst case you would use Deneb for the ornamentation.

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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