Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Rajsheisan
Frequent Visitor

Subtract percentage value from percentage value

Hi,

I am trying to subtract a measure from another based on a data field value, the subtraction working for numbers but, not percentage values. Can someone tell me what's wrong with the below DAX.

if(Type= "percentage",
IFERROR( FORMAT(CALCULATE([LastYearSameMonth]-[Cur.Month]), "0.00%"), BLANK()),
IFERROR(CALCULATE([LastYearSameMonth]-[Cur.Month]), BLANK()))

below is the data sample

Cur.MonthLastYearSameMonthDiff
98.93%98.59% 
2.9862159891.2795-1.70672

Thanks.
3 REPLIES 3
v-chenwuz-msft
Community Support
Community Support

Hi @Rajsheisan ,

 

I do not know what do these measures [LastYearSameMonth] and [Cur.Month] look like, but can you try to use the function VALUE() to transform text to number.

 

IFERROR( FORMAT(CALCULATE(value([LastYearSameMonth])-value([Cur.Month])), "0.00%"), BLANK())

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Thanks. I managed get it done.

 

Hi @Rajsheisan ,

 

I'm glad your problem is solved. If my answer was helpful to you, please mark my reply or if you have a better way, please share and mark it as a solution so more people can find the answer quickly.

 

Best Regards

Community Support Team _ chenwu zhu

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.