The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
In my recent quest to create or catalog as many DAX equivalents for Excel functions, was able to leverage COMPLEX, IMAGINARY and IMREAL into IMPOWER.
IMPOWER =
VAR __Real1 = [IMREAL]
VAR __i1 = [IMAGINARY]
VAR __power = MAX('Table'[power])
VAR __r = POWER(SQRT(POWER(__Real1,2) + POWER(__i1,2)),__power)
VAR __theta = ATAN(__i1/__Real1)
VAR __Real = __r * COS(__power * __theta)
VAR __i = __r * SIN(__power * __theta)
VAR __suffix = IF(MAX([suffix])="","i",MAX([suffix]))
RETURN
SWITCH(TRUE(),
__Real = 0 && __i = 1, __suffix,
__Real = 0 && __i = -1, "-" & __suffix,
__Real = 0, __i & __suffix,
__i = 0, __Real & "",
__i < 0 && __i = -1, __Real & "-" & __suffix,
__i < 0, __Real & "-" & ABS(__i) & __suffix,
__i = 1, __Real & "+" & __suffix,
__Real & "+" & __i & __suffix
)
I can't decide if this function is affirmational or pretentious...
Credit for the graphic goes to my son Rocket, who I have commissioned to create images for my Quick Measure Gallery entries. Proud dad moment! 🙂
eyJrIjoiMzU2ZDYwZGEtMGUyYy00ODhjLThiZDYtNTQ2MDkxZTNkZDliIiwidCI6IjRhMDQyNzQzLTM3M2EtNDNkMi04MjdiLTAwM2Y0YzdiYTFlNSIsImMiOjN9