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.
This is the output I expect in the matrix; I try to insert a row called index, its category b/a, and this index how many b times of a, please help. Thank you.
Solved! Go to Solution.
Hi @austinli37dot8 ,
I think you can custom row subtotal by measure to show index as you want.
You can transform your table as below.
Measure:
Custom Total =
VAR _VALUE =
SUM ( 'Table'[Value] )
VAR _a =
CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[category] = "a" )
VAR _b =
CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[category] = "b" )
VAR _INDEX =
DIVIDE ( _b, _a )
RETURN
IF ( HASONEVALUE ( 'Table'[category] ), _VALUE, _INDEX )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @austinli37dot8 ,
I think you can custom row subtotal by measure to show index as you want.
You can transform your table as below.
Measure:
Custom Total =
VAR _VALUE =
SUM ( 'Table'[Value] )
VAR _a =
CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[category] = "a" )
VAR _b =
CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[category] = "b" )
VAR _INDEX =
DIVIDE ( _b, _a )
RETURN
IF ( HASONEVALUE ( 'Table'[category] ), _VALUE, _INDEX )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@austinli37dot8 , refer if this way of adding custom total can help
Power BI How to get the P&L formatting right: https://youtu.be/C9K8uVfthUU
Power BI How to get two columns format Profit and Loss Statement(P&L) right: https://youtu.be/WLg85yiMgHI
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
12 | |
10 | |
9 | |
6 |