Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi there,
I have a task where i have to calculate electrical tariff. However i cant get pass through getting the DAX codes right for the conditional calculation, i would appreciate some help.
What i want to achieve is:
1. If total consumption is below 200 kwh, the total consumption will be multiplied by 0.435
2. If the total consumption is more than 200 kwh,
The first 200kwh will be multiplied by 0.435 and value over 200kwh will be multiplied by 0.509
Solved! Go to Solution.
Assuming you have an existing measure for [Total Consumption] I think the following works:
Electrical Tariff =
VAR TotalConsumption = [Total Consumption]
VAR Result =
IF (
TotalConsumption <= 200,
TotalConsumption * 0.435,
(200 * 0.435) + (TotalConsumption - 200)*0.509
)
RETURN Result
Thank you so much, works well for me !
Assuming you have an existing measure for [Total Consumption] I think the following works:
Electrical Tariff =
VAR TotalConsumption = [Total Consumption]
VAR Result =
IF (
TotalConsumption <= 200,
TotalConsumption * 0.435,
(200 * 0.435) + (TotalConsumption - 200)*0.509
)
RETURN Result
Check out the April 2026 Power BI update to learn about new features.
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.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 38 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 30 | |
| 26 | |
| 26 |