Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi All,
I have a file where in one single sheet , I'm getting a number of metrics in rows.
for eg net revenue starts at rows no 20 and goes to 200, similarly other metrices like profit etc. Currently i'm using dataflow to restrict it using top/bottom rows. I there way to make this dynamic or less manual , I don't have any other way rather than using row number. Its just numbers in the sheets so it also not possible to filter on the metric name.
Solved! Go to Solution.
Hi @DiKi-I , Thank you for reaching out to the Microsoft Community Forum.
You're currently stuck manually entering row numbers in Dataflow to extract metrics like net revenue and profit from a sheet that only contains numbers, with no metric names to filter on. Since there's no label or identifier in the data itself, dynamic filtering is tricky but there are a few ways to handle this. The most reliable method is to maintain a separate mapping table that defines the start and end rows for each metric.
For example:
| Metric | Start Row | End Row |
| NetRevenue | 20 | 200 |
| Profit | 201 | 300 |
You can reference this table in your Dataflow logic to dynamically extract the rows you need, which avoids hardcoding and makes updates much easier when the structure changes. If you have control over the data before it reaches the sheet, another option is to tag each row during ingestion with the metric name in a separate column.
For example:
| Metric | Value |
| NetRevenue | 100.2 |
| NetRevenue | 105.6 |
| Profit | 55.1 |
This lets you filter rows dynamically by metric name in Dataflow without relying on row positions. Finally, if your sheet has consistent patterns like blank rows between metric blocks, you can use a Google Apps Script to detect the start and end of each block automatically.
Example:
function detectMetricBlocks() {
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
const data = sheet.getDataRange().getValues();
const blocks = [];
let start = null;
for (let i = 0; i < data.length; i++) {
const isEmpty = data[i].every(cell => cell === "" || cell === null);
if (!isEmpty && start === null) start = i + 1;
else if (isEmpty && start !== null) {
blocks.push({ start, end: i });
start = null;
}
}
if (start !== null) blocks.push({ start, end: data.length });
return blocks;
}
If this helped solve the issue, please consider marking it “Accept as Solution” and giving a ‘Kudos’ so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
Hi @DiKi-I , Just checking in—were you able to resolve the issue?
If one of the replies helped, please consider marking it as "Accept as Solution" and giving a 'Kudos'. Doing so can assist other community members in finding answers more quickly.
Thank you!
Hi @DiKi-I ,
I hope the information shared was helpful. If you have any additional questions or would like to explore the topic further, feel free to reach out. If any of the responses resolved your issue, please mark it "Accept as solution" and give it a 'Kudos' to support other members in the community.
Thank you!
Hi @DiKi-I ,
I wanted to follow up and see if you’ve had a chance to review the information provided here.
If any of the responses helped solve your issue, please consider marking it "Accept as Solution" and giving it a 'Kudos' to help others easily find it.
Let me know if you have any further questions!
Hi @DiKi-I , Thank you for reaching out to the Microsoft Community Forum.
You're currently stuck manually entering row numbers in Dataflow to extract metrics like net revenue and profit from a sheet that only contains numbers, with no metric names to filter on. Since there's no label or identifier in the data itself, dynamic filtering is tricky but there are a few ways to handle this. The most reliable method is to maintain a separate mapping table that defines the start and end rows for each metric.
For example:
| Metric | Start Row | End Row |
| NetRevenue | 20 | 200 |
| Profit | 201 | 300 |
You can reference this table in your Dataflow logic to dynamically extract the rows you need, which avoids hardcoding and makes updates much easier when the structure changes. If you have control over the data before it reaches the sheet, another option is to tag each row during ingestion with the metric name in a separate column.
For example:
| Metric | Value |
| NetRevenue | 100.2 |
| NetRevenue | 105.6 |
| Profit | 55.1 |
This lets you filter rows dynamically by metric name in Dataflow without relying on row positions. Finally, if your sheet has consistent patterns like blank rows between metric blocks, you can use a Google Apps Script to detect the start and end of each block automatically.
Example:
function detectMetricBlocks() {
const sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
const data = sheet.getDataRange().getValues();
const blocks = [];
let start = null;
for (let i = 0; i < data.length; i++) {
const isEmpty = data[i].every(cell => cell === "" || cell === null);
if (!isEmpty && start === null) start = i + 1;
else if (isEmpty && start !== null) {
blocks.push({ start, end: i });
start = null;
}
}
if (start !== null) blocks.push({ start, end: data.length });
return blocks;
}
If this helped solve the issue, please consider marking it “Accept as Solution” and giving a ‘Kudos’ so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you.
Hi @DiKi-I
Is it not possible that on the columns you will have some information which could identify which roads you need So that will allow you to then filter then dynamically?
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 8 | |
| 8 | |
| 7 |
| User | Count |
|---|---|
| 32 | |
| 31 | |
| 20 | |
| 19 | |
| 17 |