March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All ,
Created a custom column using format
Rounded data =
VAR _Var = 'Emporia Device Usage'[Usages KWH]
RETURN
SWITCH(
TRUE(),
_Var < 0.01 , FORMAT('Emporia Device Usage'[Usages KWH], "0"),
_Var < 1 , FORMAT('Emporia Device Usage'[Usages KWH], "0.##"),
_Var < 10 , FORMAT('Emporia Device Usage'[Usages KWH], "##.##"),
_Var < 100, FORMAT('Emporia Device Usage'[Usages KWH],"##.#"),
_Var > 100 ,Format('Emporia Device Usage'[Usages KWH],"###"))
But recieve errors like below
Thanks , James.
Solved! Go to Solution.
Hi @JamesBurke The Format function in Power BI DAX converts the data type to a string. This function is used to format a value as a string according to a specified format. Your measure [Total Kwh] most problably summing up your calculated column which is techincally not possible.
To overcome this situation, use sumx and value function to evaluate sum. For example:
Total = SUMX(
orders,
VALUE(orders[StringOrder])
)
Here orders[StringOrder] column have used format function and data type is text.
Hope this helps!!
If this solved your problem, please accept it as a solution!!
Best Regards,
Shahariar Hafiz
Hi @JamesBurke The Format function in Power BI DAX converts the data type to a string. This function is used to format a value as a string according to a specified format. Your measure [Total Kwh] most problably summing up your calculated column which is techincally not possible.
To overcome this situation, use sumx and value function to evaluate sum. For example:
Total = SUMX(
orders,
VALUE(orders[StringOrder])
)
Here orders[StringOrder] column have used format function and data type is text.
Hope this helps!!
If this solved your problem, please accept it as a solution!!
Best Regards,
Shahariar Hafiz
@JamesBurke What's the data type of 'Emporia Device Usage'[Usages KWH] column?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |