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
Anonymous
Not applicable

Calculated Column

Hi Guys,

 

Please refer the below  table where I have the first 2 columns in my report and the 3rd is the desired column when the Annual Usage is divided by 1000 where ever type name is Electric. 

 

Can you help me with the measure to get this?

 

I've tried calculate function but its not helping me. Below is the expression used by me:

 

Annual Usage (MWh) = CALCULATE(SUM(Deals[AnnualUsage]),FILTER(Deals,Deals[typename]="Electric"))/1000

 

What should I use instead of sum to make it work?

 

Regards,

Himanshu

 

Annual UsageTypenameDesired Output Column: Annual Usage (MWh)
1614892Electric1615
100000Gas0
175400Electric175.4
2356765Gas0
16877654Electric16878
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a measure like

Annual Usage (MWh) = round(CALCULATE(SUM(Deals[AnnualUsage]),FILTER(Deals,Deals[typename]="Electric"))/1000.0,0)

 

 

Or new column like

new column = if([typename]="Electric", round([AnnualUsage]/1000.0,0), 0) +0 

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

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

@amitchandak Hi Amit,

 

Actually there is an issue with the column I created.

 

Please refer the below table:

 

Annual UsageTypenameDesired Output Column: Annual Usage (MWh)Unit
1614892Electric1615kwh
100000Gas0THM
175400Electric175400MWh
2356765Gas0THM
16877654Electric16878kwh

 

I actually want the desired output column for the unit kwh only. I dont want values for "Unit" MWh to change.

What can be done in this scenario?

new column = if([typename]="Electric", round([AnnualUsage]/1000.0,0), 0) +0 : I want a filter where Unit = kwh in my calculation.

 

I'm basically converting only kwh values to MWh.

 

Regards,

Himanshu

amitchandak
Super User
Super User

@Anonymous , Try a measure like

Annual Usage (MWh) = round(CALCULATE(SUM(Deals[AnnualUsage]),FILTER(Deals,Deals[typename]="Electric"))/1000.0,0)

 

 

Or new column like

new column = if([typename]="Electric", round([AnnualUsage]/1000.0,0), 0) +0 

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
Anonymous
Not applicable

Thanks for your help !!!

 

The below solved my issue

 

new column = if([typename]="Electric", round([AnnualUsage]/1000.0,0), 0) +0 

 

Regards,

Himanshu

aj1973
Community Champion
Community Champion

Hi @Anonymous 

the measure is correct if you want to see the aggregation filtered by Electric in a Card Visual not in the Table

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Kudoed Authors