This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi .
I'm doing stack bar visualization with date on xaxis & City as legend with 2 measures A & B. Now how can i write dax expressoin to show stack bar to compare Capital vs operating spend .?
Measure A is % of Capitl Spend ( when Operating type ='C' then actuals column)
Measure B is % of Operating Spend( when operarting type ='O' then Actuals columns)
Thanks
RF
Solved! Go to Solution.
Hi @refint650 ,
I create a simple sample. Please check if this could meet your requirements:
Measure =
VAR TypeAmount =
SUM ( data[Amount] )
VAR AllAmount =
CALCULATE ( SUM ( data[Amount] ), ALL ( data ) )
RETURN
DIVIDE ( TypeAmount, AllAmount )
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Try these measures
Total spend = sum(data[amount])
Capital spend = calculate([total spend],data[operating type]="C")
Operating spend = calculate([total spend],data[operating type]="O")
Capital spend (%) = divide([capital spend],[total spend])
Operating spend (%) = divide([operating spend],[total spend])
If this does not get your desired result, then share the link from where i can download your PBI file and show the exected result very clearly.
Hi Ashish
Appreciate for help. how can we show capital & Operating in same single stacked bar in single dax calculation.?
RF
Hi @refint650 ,
I create a simple sample. Please check if this could meet your requirements:
Measure =
VAR TypeAmount =
SUM ( data[Amount] )
VAR AllAmount =
CALCULATE ( SUM ( data[Amount] ), ALL ( data ) )
RETURN
DIVIDE ( TypeAmount, AllAmount )
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
Share some data to work with.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 26 | |
| 25 | |
| 22 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 50 | |
| 26 | |
| 20 | |
| 19 |