Forum Discussion
DaX Calculation
- 5 years ago
Hi Anonymous
You can create a Calculated column or Measure.
1 Calculated column
Annual Usage (MWh) = IF ( [Type Name] = "Electric" && [Unit] IN { "mWh" }, ROUND ( [Annual Usage] * 1000, 0 ), IF ( [Type Name] = "Electric", ROUND([Annual Usage],0), 0 ) )2 Measure
Annual Usage (MWh)_measure = VAR type_name = SELECTEDVALUE ( View_DealClosing[Type Name] ) VAR unit = SELECTEDVALUE ( View_DealClosing[Unit] ) VAR usage = SELECTEDVALUE ( View_DealClosing[Annual Usage] ) RETURN IF ( type_name = "Electric" && unit IN { "mWh" }, ROUND ( usage * 1000, 0 ), IF ( type_name = "Electric", ROUND(usage,0), 0 ) )The result looks like this:
Fore more details, you can refer the attached pbix file.
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous
You can create a Calculated column or Measure.
1 Calculated column
Annual Usage (MWh) =
IF (
[Type Name] = "Electric"
&& [Unit] IN { "mWh" },
ROUND ( [Annual Usage] * 1000, 0 ),
IF ( [Type Name] = "Electric", ROUND([Annual Usage],0), 0 )
)
2 Measure
Annual Usage (MWh)_measure =
VAR type_name =
SELECTEDVALUE ( View_DealClosing[Type Name] )
VAR unit =
SELECTEDVALUE ( View_DealClosing[Unit] )
VAR usage =
SELECTEDVALUE ( View_DealClosing[Annual Usage] )
RETURN
IF (
type_name = "Electric"
&& unit IN { "mWh" },
ROUND ( usage * 1000, 0 ),
IF ( type_name = "Electric", ROUND(usage,0), 0 )
)
The result looks like this:
Fore more details, you can refer the attached pbix file.
Best Regards
Caiyun Zheng
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for the suggestion.
It resolved my issue 🙂
Regards,
Himanshu