The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi there,
I run the following calculation and typically it works, for some days I've been receiving this message:
"an argument of function power has the wrong data type or is too..."
this is the code:
Solved! Go to Solution.
BTW, using variables and a SWITCH makes this kind of measure much easier to read.
Try something like this:
Output =
VAR _X = SELECTEDVALUE ( 'Horizon'[X] )
VAR _Qtr = SUM ( '3m'[Y] ) / SUM ( Value[Y] )
VAR _Year = SUM ( '12'[Y] ) / SUM ( Value[Y] )
RETURN
SWITCH (
_X,
"3m (annualized)",
IF ( _Qtr ^ 4 = 0, 0, ( _Qtr ^ 4 - 1 ) * 100 ),
"3m",
IF ( _Qtr = 0, 0, ( _Qtr - 1 ) * 100 ),
"12m",
IF ( _Year = 0, 0, ( _Year - 1 ) * 100 )
)
Hi @Anonymous
Does @AlexisOlson 's method help you resolve the issue? If does, please kindly Accept it as the solution. More people will benefit from it.
Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Refer to:
How to Get Your Question Answered Quickly - Microsoft Power BI Community
How to provide sample data in the Power BI Forum - Microsoft Power BI Community
Best Regards,
Eyelyn Qin
Hi @Anonymous
Does @AlexisOlson 's method help you resolve the issue? If does, please kindly Accept it as the solution. More people will benefit from it.
Or if you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.
Refer to:
How to Get Your Question Answered Quickly - Microsoft Power BI Community
How to provide sample data in the Power BI Forum - Microsoft Power BI Community
Best Regards,
Eyelyn Qin
BTW, using variables and a SWITCH makes this kind of measure much easier to read.
Try something like this:
Output =
VAR _X = SELECTEDVALUE ( 'Horizon'[X] )
VAR _Qtr = SUM ( '3m'[Y] ) / SUM ( Value[Y] )
VAR _Year = SUM ( '12'[Y] ) / SUM ( Value[Y] )
RETURN
SWITCH (
_X,
"3m (annualized)",
IF ( _Qtr ^ 4 = 0, 0, ( _Qtr ^ 4 - 1 ) * 100 ),
"3m",
IF ( _Qtr = 0, 0, ( _Qtr - 1 ) * 100 ),
"12m",
IF ( _Year = 0, 0, ( _Year - 1 ) * 100 )
)