Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sonam7
Microsoft Employee
Microsoft Employee

Indefinite

Hello everyone

I have the following table in Excel, I'm trying to do the same in PowerBI, but the result is not as expected.

I've created a measure for UnitsbyType

UnitsbyType á IF(MAX('MASCI vwEnvironments'[Type]) á "HC4",[Total Envs]*4,IF(MAX('MASCI vwEnvironments'[Type]) á "HC8", [Total Envs]*8,IF(MAX('MASCI vwEnvironments'[Type])'"HC12",[Total Envs]*12,IF(MAX('MASCI vwEnvironments'[Type]) á "HC16",[Total Envs]*16,[Total Envs]*1))))
TotalUnits.PNGAllocation Total.PNGAllocation%.PNG
Next I want to calculate total units as in Excel by adding UnitsByType for each branch, i.e. Prod, ASDB, ProdNext, etc. This is what I'm trying to do, but it doesn't give me the right value.
Total Units - SUMX(Summarize('MASCI vwEnvironments','MASCI vwEnvironments'[Branch]),[UnitbyType])
Can someone please help me with how I get these values in Excel?
Thank you
1 ACCEPTED SOLUTION
v-xicai
Community Support
Community Support

Hi @sonam7 ,

 

You may create a measure like DAX below .

 

 

Total Units=

VAR _table = SUMMARIZE( 'MASCI vwEnvironments', 'MASCI vwEnvironments'[Branch], "_Value", [UnitbyType])

RETURN

IF(HASONEVALUE('MASCI vwEnvironments'[Branch]), [UnitbyType], SUMX(_table,[_Value]))

 

 

Best Regards,

Amy 

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xicai
Community Support
Community Support

Hi @sonam7 ,

 

You may create a measure like DAX below .

 

 

Total Units=

VAR _table = SUMMARIZE( 'MASCI vwEnvironments', 'MASCI vwEnvironments'[Branch], "_Value", [UnitbyType])

RETURN

IF(HASONEVALUE('MASCI vwEnvironments'[Branch]), [UnitbyType], SUMX(_table,[_Value]))

 

 

Best Regards,

Amy 

 

Community Support Team _ Amy

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

Assume your measure is M1 and group by is type, try like

sumx(summarize(Table,Table[Type],"_1", [M1]),[_1])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.