Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi,
I want to get the total of a column in a matrix but only until a row in another column is blank or cero.
How can I do that?
Thank you community!
Claudio
You can write a measure that tests if the other row is blank, or equals zero, and only return a total if the other row has a number. Every cell in a Power BI report is calculated independently, unlike a spreadsheet where cells often depend on each other. If you need help with the DAX please create a small sample table in excel, or in a power bi file and make it available and I'll help you with the coding.
Help when you know. Ask when you don't!
Hi,
For column B,C,D I need the sum until the last row in the B column is no blank.
For column, D,E,F, I need to sum until the first row in the B column is blank.
You can see what I need in the row 33.
Thank you very much!
Hi @cnitscher
You can achieve this using the below columns and measures.
Step 1: Create 2 columns as shown below
Sales(with zeros for future) = IF(Sheet1[Sales this Year] = 0, 0, Sheet1[Sales Last Year])
Stocks(with zeros for future) = IF(Sheet1[Stock TY] = 0, 0, Sheet1[Stock LY])
Step2: Create the below 4 measures
Total Sales this year = SUM(Sheet1[Sales this Year])
Total Sales last year = SUM(Sheet1[Sales(with zeros for future)])
Total Stocks this year = SUM(Sheet1[Stock TY])
Total Stocks last year = SUM(Sheet1[Stocks(with zeros for future)])
Notice that the newly created columns are used in the measure
The Output screenshots are given below
When these measures are used in the table, they look as shown below
If this is what you are lookng for, pls. mark this as solution and appreciate with a kudos!!
Regards,
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
8 | |
8 | |
8 |
User | Count |
---|---|
13 | |
12 | |
11 | |
10 | |
9 |