Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 28 |
| User | Count |
|---|---|
| 136 | |
| 102 | |
| 68 | |
| 66 | |
| 58 |