Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
Hello Everyone here is link to my sample dataset and pbix.
Test
here is the pbix screenshot
Issue: Depending on measures selected, scaling is very off and doesnt show well.
Requirment: Scale the other measures to match with the biggest measure in this example, Total Impression, to have all the lines be readable( i can turn off axis values and fix the tooltip)
Preference: Function, DAX, html visual, deneb anything to solve that issue dynamically.
Thank you in advanced
Solved! Go to Solution.
Hi @eliasayyy,
I hope you are doing well ☺️❤️
So unfortunately I can't download the file but based on my understand you want to dynamically scale measures in a line chart so all lines are readable
You can try this Deneb (Vega-Lite) that automatically normalizes your data:
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"name": "dataset"},
"transform": [
{
"aggregate": [
{"op": "sum", "field": "Impressions", "as": "Total Impressions"},
{"op": "sum", "field": "Clicks", "as": "Total Clicks"},
{"op": "sum", "field": "Spend", "as": "Total Spend"},
{"op": "average", "field": "CTR", "as": "CTR"},
{"op": "average", "field": "CPC", "as": "CPC"}
],
"groupby": ["Date"]
},
{
"calculate": "datum['Total Impressions']",
"as": "Impressions_norm"
},
{
"fold": [
"Total Impressions",
"Total Clicks",
"Total Spend",
"CTR",
"CPC"
],
"as": ["Measure", "Value"]
},
{
"joinaggregate": [
{
"op": "max",
"field": "Value",
"as": "max_value"
}
],
"groupby": ["Measure"]
},
{
"calculate": "datum.Value / datum.max_value",
"as": "normalized_value"
},
{
"calculate": "datum.Value",
"as": "original_value"
}
],
"encoding": {
"x": {
"field": "Date",
"type": "temporal",
"title": "Date",
"axis": {"grid": false}
},
"y": {
"field": "normalized_value",
"type": "quantitative",
"title": "Normalized Scale (0 to 1)",
"axis": {
"grid": true,
"format": ".0%",
"title": null
}
},
"color": {
"field": "Measure",
"type": "nominal",
"title": "Measures",
"scale": {"scheme": "category10"}
},
"tooltip": [
{"field": "Date", "type": "temporal", "title": "Date"},
{"field": "Measure", "type": "nominal", "title": "Measure"},
{
"field": "original_value",
"type": "quantitative",
"title": "Actual Value",
"format": ",.0f"
},
{
"field": "normalized_value",
"type": "quantitative",
"title": "Normalized",
"format": ".1%"
}
]
},
"layer": [
{
"mark": {
"type": "line",
"strokeWidth": 2,
"interpolate": "monotone"
}
},
{
"selection": {
"hover": {
"type": "single",
"on": "mouseover",
"nearest": true,
"empty": "none"
}
},
"mark": {
"type": "point",
"size": 100,
"opacity": 0
}
}
],
"config": {
"view": {"stroke": null},
"axis": {
"domainWidth": 1,
"labelFontSize": 11,
"titleFontSize": 13
},
"legend": {
"titleFontSize": 12,
"labelFontSize": 11,
"symbolSize": 100
}
}
}
If you prefer a DAX solution create these measures:
// Base Measures (you should already have these)
Total Impressions = SUM(random_campaign_data[Impressions])
Total Clicks = SUM(random_campaign_data[Clicks])
Total Spend = SUM(random_campaign_data[Spend])
Avg CTR = AVERAGE(random_campaign_data[CTR])
Avg CPC = AVERAGE(random_campaign_data[CPC])
// Normalized Measures
Normalized Impressions =
VAR MaxValue = MAXX(ALLSELECTED('Date'[Date]), [Total Impressions])
RETURN DIVIDE([Total Impressions], MaxValue, 0)
Normalized Clicks =
VAR MaxValue = MAXX(ALLSELECTED('Date'[Date]), [Total Clicks])
RETURN DIVIDE([Total Clicks], MaxValue, 0)
Normalized Spend =
VAR MaxValue = MAXX(ALLSELECTED('Date'[Date]), [Total Spend])
RETURN DIVIDE([Total Spend], MaxValue, 0)
Normalized CTR =
VAR MaxValue = MAXX(ALLSELECTED('Date'[Date]), [Avg CTR])
RETURN DIVIDE([Avg CTR], MaxValue, 0)
Normalized CPC =
VAR MaxValue = MAXX(ALLSELECTED('Date'[Date]), [Avg CPC])
RETURN DIVIDE([Avg CPC], MaxValue, 0)
If you want to ask any questions just mention me ☺️❤️
Hi @eliasayyy ,
I understand und you are right that the chart looks nicer if the range of the different measures is smaller. But I wouldn't recommend to do such a scaling except your visualisations purpose is just to look good.
Of course it looks nicer if the values are closer but the viewer of your report will think there are closer but obviously they are not. That is very misleading.
Other options that came to my mind:
Hope that helps and that at least one of the options meets your requirements.
Hi @eliasayyy,
I hope you are doing well ☺️❤️
So unfortunately I can't download the file but based on my understand you want to dynamically scale measures in a line chart so all lines are readable
You can try this Deneb (Vega-Lite) that automatically normalizes your data:
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {"name": "dataset"},
"transform": [
{
"aggregate": [
{"op": "sum", "field": "Impressions", "as": "Total Impressions"},
{"op": "sum", "field": "Clicks", "as": "Total Clicks"},
{"op": "sum", "field": "Spend", "as": "Total Spend"},
{"op": "average", "field": "CTR", "as": "CTR"},
{"op": "average", "field": "CPC", "as": "CPC"}
],
"groupby": ["Date"]
},
{
"calculate": "datum['Total Impressions']",
"as": "Impressions_norm"
},
{
"fold": [
"Total Impressions",
"Total Clicks",
"Total Spend",
"CTR",
"CPC"
],
"as": ["Measure", "Value"]
},
{
"joinaggregate": [
{
"op": "max",
"field": "Value",
"as": "max_value"
}
],
"groupby": ["Measure"]
},
{
"calculate": "datum.Value / datum.max_value",
"as": "normalized_value"
},
{
"calculate": "datum.Value",
"as": "original_value"
}
],
"encoding": {
"x": {
"field": "Date",
"type": "temporal",
"title": "Date",
"axis": {"grid": false}
},
"y": {
"field": "normalized_value",
"type": "quantitative",
"title": "Normalized Scale (0 to 1)",
"axis": {
"grid": true,
"format": ".0%",
"title": null
}
},
"color": {
"field": "Measure",
"type": "nominal",
"title": "Measures",
"scale": {"scheme": "category10"}
},
"tooltip": [
{"field": "Date", "type": "temporal", "title": "Date"},
{"field": "Measure", "type": "nominal", "title": "Measure"},
{
"field": "original_value",
"type": "quantitative",
"title": "Actual Value",
"format": ",.0f"
},
{
"field": "normalized_value",
"type": "quantitative",
"title": "Normalized",
"format": ".1%"
}
]
},
"layer": [
{
"mark": {
"type": "line",
"strokeWidth": 2,
"interpolate": "monotone"
}
},
{
"selection": {
"hover": {
"type": "single",
"on": "mouseover",
"nearest": true,
"empty": "none"
}
},
"mark": {
"type": "point",
"size": 100,
"opacity": 0
}
}
],
"config": {
"view": {"stroke": null},
"axis": {
"domainWidth": 1,
"labelFontSize": 11,
"titleFontSize": 13
},
"legend": {
"titleFontSize": 12,
"labelFontSize": 11,
"symbolSize": 100
}
}
}
If you prefer a DAX solution create these measures:
// Base Measures (you should already have these)
Total Impressions = SUM(random_campaign_data[Impressions])
Total Clicks = SUM(random_campaign_data[Clicks])
Total Spend = SUM(random_campaign_data[Spend])
Avg CTR = AVERAGE(random_campaign_data[CTR])
Avg CPC = AVERAGE(random_campaign_data[CPC])
// Normalized Measures
Normalized Impressions =
VAR MaxValue = MAXX(ALLSELECTED('Date'[Date]), [Total Impressions])
RETURN DIVIDE([Total Impressions], MaxValue, 0)
Normalized Clicks =
VAR MaxValue = MAXX(ALLSELECTED('Date'[Date]), [Total Clicks])
RETURN DIVIDE([Total Clicks], MaxValue, 0)
Normalized Spend =
VAR MaxValue = MAXX(ALLSELECTED('Date'[Date]), [Total Spend])
RETURN DIVIDE([Total Spend], MaxValue, 0)
Normalized CTR =
VAR MaxValue = MAXX(ALLSELECTED('Date'[Date]), [Avg CTR])
RETURN DIVIDE([Avg CTR], MaxValue, 0)
Normalized CPC =
VAR MaxValue = MAXX(ALLSELECTED('Date'[Date]), [Avg CPC])
RETURN DIVIDE([Avg CPC], MaxValue, 0)
If you want to ask any questions just mention me ☺️❤️
Hi @eliasayyy ,
Thanks for reaching out to the Microsoft fabric community forum.
I would also take a moment to thank @Ahmed-Elfeel , 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 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’re always here to support you
Best Regards,
Community Support Team
Hi @eliasayyy ,
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’re always here to support you
Best Regards,
Community Support Team
Hi @eliasayyy ,
what do you exactly mean by "Scale the other measures to match with the biggest measure"? Could you give an example? In your example "Total impressions" is the "biggest" measure. How should the other measures be scaled for let's say 23 Nov? What exactly do you wanna show and compare?
Thank you for your reply. my aim is to have the chart look nicer, so ltes ay on 23 november, we had 181k impressions while clicks had 6904, so maybe scale t to be 100k for example so the line chart will look more readable and not close to 0. here i just did a x10 on clicks just to show you
however i dont want a static x10 i need it dynamically to scale because a x10 if you see on nov 26 is now higher than impressions. my goal is just to make the chart readable and see trend of other measures because for now only the impression trend looks decent and tell a story
Hi @eliasayyy ,
I understand und you are right that the chart looks nicer if the range of the different measures is smaller. But I wouldn't recommend to do such a scaling except your visualisations purpose is just to look good.
Of course it looks nicer if the values are closer but the viewer of your report will think there are closer but obviously they are not. That is very misleading.
Other options that came to my mind:
Hope that helps and that at least one of the options meets your requirements.
I believe this will help you
https://www.sqlbi.com/articles/using-dax-to-control-a-chart-range-in-power-bi/
In the above article/video SQLBI shows you how to create a measure that computes the maximum value of a measure regardless of any selection. You can then use that measure to define the maximum value of the Y-axis.
Not sure this is exactly what you are looking for, but I believe might be a starting point
Best
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
Thank you for your reply, Unfortunetly this only fixes max axis and min axis not the measure themselves as tehre is multiple measures with different values, i need to actually have a daynamic funtion to scale the selected measures, so lets say impressions on nov 1 2025 was 3000 while clicks was 100, the scaling is very bad on chart so i need to scale the clicks based on the max value of this row which is 3000 and make it close to it like 2000 so it looks better visually on the chart
I understand and believe you need to extend that logic, calculating for each measure max and min and choose the value you want for the graph. Otherwise it is unclear to me how could Power BI understand what you want to get
Best
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
yes it is an annoying thing i agree. im just trying to think of a logi to maybe scale the other measures based on the biggest measure
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 61 | |
| 49 | |
| 30 | |
| 25 | |
| 23 |
| User | Count |
|---|---|
| 129 | |
| 104 | |
| 56 | |
| 39 | |
| 31 |