Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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 Usage | Typename | Desired Output Column: Annual Usage (MWh) |
| 1614892 | Electric | 1615 |
| 100000 | Gas | 0 |
| 175400 | Electric | 175.4 |
| 2356765 | Gas | 0 |
| 16877654 | Electric | 16878 |
Solved! Go to Solution.
@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
@amitchandak Hi Amit,
Actually there is an issue with the column I created.
Please refer the below table:
| Annual Usage | Typename | Desired Output Column: Annual Usage (MWh) | Unit |
| 1614892 | Electric | 1615 | kwh |
| 100000 | Gas | 0 | THM |
| 175400 | Electric | 175400 | MWh |
| 2356765 | Gas | 0 | THM |
| 16877654 | Electric | 16878 | kwh |
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
@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
Thanks for your help !!!
The below solved my issue
new column = if([typename]="Electric", round([AnnualUsage]/1000.0,0), 0) +0
Regards,
Himanshu
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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 47 | |
| 44 | |
| 40 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 70 | |
| 68 | |
| 33 | |
| 32 | |
| 32 |