Forum Discussion
netanel
2 years agoPost Prodigy
calculate with diffrent types
Hi All, I need your help in this case, I have this measure that combines different values with two different types percentage and whole number. Combined_Measure = SWITCH ( TRUE (), ...
- 2 years agoHi thanks but
I found the solution
I just wrapped the measure separately with the following adjustments:
Prior Year % =VAR SumLast6Months = [Combined Measures | Sum Last 6 Months]VAR SumLast6MonthsLastYear = [Combined Measures | Sum Last Year]VAR NoDataAvailable = ISBLANK(SumLast6Months) || SumLast6Months = "" || ISBLANK(SumLast6MonthsLastYear) || SumLast6MonthsLastYear = ""VAR SumLast6MonthsNumeric = IF(RIGHT(SumLast6Months, 1) = "%", VALUE(LEFT(SumLast6Months, LEN(SumLast6Months) - 1)) / 100, SumLast6Months)VAR SumLast6MonthsLastYearNumeric = IF(RIGHT(SumLast6MonthsLastYear, 1) = "%", VALUE(LEFT(SumLast6MonthsLastYear, LEN(SumLast6MonthsLastYear) - 1)) / 100, SumLast6MonthsLastYear)VAR PercentageChange = DIVIDE(SumLast6MonthsNumeric, SumLast6MonthsLastYearNumeric) - 1RETURNIF (NoDataAvailable,BLANK(),FORMAT(PercentageChange, "0.00%"))
Anonymous
2 years agoNot applicable
Hi netanel ,
Could you provide some screenshot information of the data model and describe it, it would be great to have relevant test data.
Best Regards,
Adamk Kong
netanel
2 years agoPost Prodigy
Hi thanks but
I found the solution
I just wrapped the measure separately with the following adjustments:
Prior Year % =
I found the solution
I just wrapped the measure separately with the following adjustments:
Prior Year % =
VAR SumLast6Months = [Combined Measures | Sum Last 6 Months]
VAR SumLast6MonthsLastYear = [Combined Measures | Sum Last Year]
VAR NoDataAvailable = ISBLANK(SumLast6Months) || SumLast6Months = "" || ISBLANK(SumLast6MonthsLastYear) || SumLast6MonthsLastYear = ""
VAR SumLast6MonthsNumeric = IF(RIGHT(SumLast6Months, 1) = "%", VALUE(LEFT(SumLast6Months, LEN(SumLast6Months) - 1)) / 100, SumLast6Months)
VAR SumLast6MonthsLastYearNumeric = IF(RIGHT(SumLast6MonthsLastYear, 1) = "%", VALUE(LEFT(SumLast6MonthsLastYear, LEN(SumLast6MonthsLastYear) - 1)) / 100, SumLast6MonthsLastYear)
VAR PercentageChange = DIVIDE(SumLast6MonthsNumeric, SumLast6MonthsLastYearNumeric) - 1
RETURN
IF (
NoDataAvailable,
BLANK(),
FORMAT(PercentageChange, "0.00%")
)