Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
I'm a user of Tableau but a totally new user of Power BI.
Im trying to create a new column to show the sum of COST which can be affected by active filters on visual.
I have a sample data as below.
| item | ITEM GROUP | COST |
| SEATCOVER | VICTRON | 9 |
| WASHER | GCMSB | 0.5 |
| NUT | GCMSB | 1 |
| COLLAR | CW | 5 |
| SHAFT | GCMSB | 7 |
| COVER | BL | 10 |
My expected outcome in Power BI whgen no active filters applied.
| item | ITEM GROUP | COST | Total Cost |
| SEATCOVER | VICTRON | 9 | 32.5 |
| WASHER | GCMSB | 0.5 | 32.5 |
| NUT | GCMSB | 1 | 32.5 |
| COLLAR | CW | 5 | 32.5 |
| SHAFT | GCMSB | 7 | 32.5 |
| COVER | BL | 10 | 32.5 |
When ITEM GROUP is not GCMSB.
| item | ITEM GROUP | COST | Total Cost |
| SEATCOVER | VICTRON | 9 | 24 |
| COLLAR | CW | 5 | 24 |
| COVER | BL | 10 | 24 |
If possible, I wish there is no hard coding in the command line, and can works dynamically with the active filters.
Thanks !!
Solved! Go to Solution.
Hi @zhejun728 ,
I create a table as you mentioned. Also I created a Slicer.
As tamerj1 said, you can create a measure and here is the DAX code.
Total Cost =
CALCULATE ( SUM ( 'Table'[COST] ), ALLSELECTED ( 'Table' ) )
Finally you can get what you want.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @zhejun728 ,
I create a table as you mentioned. Also I created a Slicer.
As tamerj1 said, you can create a measure and here is the DAX code.
Total Cost =
CALCULATE ( SUM ( 'Table'[COST] ), ALLSELECTED ( 'Table' ) )
Finally you can get what you want.
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank Yilong ! That's help !!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 5 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 15 | |
| 8 | |
| 8 | |
| 8 |