Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I am using a matrix to display some data.
I have one column for months, rows for parent category and sub category and values for quantity of item, price of item and a measure for sum(quantity) * sum(price per item).
Above is what it looks like without the measure column.
Below is with measure, the measure however for totals shows the wrong value. Is there an easy way of creating a total for each month in the matrix itself.
Thanks,
H
Try this:
IF(ISFILTERED('Table'[Parent Category Name]) , [Qty]*[Price per Item] , SUMX('Table', [Qty]*[Price per Item] ))
Thanks CoreyP but unfortunately I can't get that working.
The Table structure the matrix uses is as follows;
Category
Id | Name | ParentCategoryName (Self Referencing to Category Id) |
Product
Id | Category Id | Name | Price Per Item |
Amount
Id | Product Id | Date Wanted (Month) | Quantity |
Thanks
H
Yeah, you'd just need to edit it with your specific table names.. so something more like this:
IF( ISFILTERED('Category'[ParentCategoryName]), SUM('Amount'[Quantity]) * SUM('Product'[Price Per Item]) , SUMX('Category' , SUM('Amount'[Quantity]) * SUM('Product'[Price Per Item]) )
This is basically saying, if the measure is in the context of a parent category name, do one operation, and when it's outside of that context, aka the total line, do a sum of the measure.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
67 | |
51 | |
39 | |
26 |
User | Count |
---|---|
87 | |
55 | |
45 | |
42 | |
36 |