Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi guys,
I would like to display Energy Data, for instance: 900 t. kWh -> 900 MWh
I want to check the value and use the next level unit (kWh, MWh, TWh) if the number exceeds 1,000.
Does anyone know how to do that or knows a work around?
Cheers, Pete
Solved! Go to Solution.
Hi @Pete230,
I would suggest you use the SWITCH function in a measure:
Energy Unit =
SWITCH(TRUE(),
SUM('Table'[Energy])<1000, "kWh",
SUM('Table'[Energy])<1000000, "MWh",
SUM('Table'[Energy])>=1000000, "TWh"
)
In this formula, we are checking the energy value using the Switch function, and then assigning the appropriate unit based on the value. If the energy value is less than 1000, we display it in kWh, if it is less than 1000000, we display it in MWh, and if it exceeds 1,000,000, we display it in TWh.
Best regards,
Isaac Chavarria
If this post helps, then please consider Accepting it as the solution and giving Kudos to help the other members find it more quickly
Perfect, that was what I was looking for, thanks!
Hi @Pete230,
I would suggest you use the SWITCH function in a measure:
Energy Unit =
SWITCH(TRUE(),
SUM('Table'[Energy])<1000, "kWh",
SUM('Table'[Energy])<1000000, "MWh",
SUM('Table'[Energy])>=1000000, "TWh"
)
In this formula, we are checking the energy value using the Switch function, and then assigning the appropriate unit based on the value. If the energy value is less than 1000, we display it in kWh, if it is less than 1000000, we display it in MWh, and if it exceeds 1,000,000, we display it in TWh.
Best regards,
Isaac Chavarria
If this post helps, then please consider Accepting it as the solution and giving Kudos to help the other members find it more quickly
User | Count |
---|---|
96 | |
85 | |
77 | |
66 | |
63 |
User | Count |
---|---|
110 | |
96 | |
96 | |
67 | |
59 |