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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DLU
Helper I
Helper I

Error converting % value of type text to type numeric/date

Dear community, 

I'm pretty new with PowerBI and I build my first own P&L statement today and it turned out great. But now I want to calculate the difference between actual and budget but I get the error as mentioned in the title. I wrote multiple DAX measures to get to the P&L and the measure I want to use to calculate the difference is the following: 

 

Total Amount = VAR CalcType = SELECTEDVALUE(Headers[Calctype]) // should it be a simple total or a running total?
VAR DisplayDetailCode = SELECTEDVALUE(Headers[Detail]) // 1 if the detail should display and 0 if detail should be hidden
VAR isSubHeaderVisible = ISFILTERED('WWN Mapping'[Subheader 1]) //we need to know if the sub header is trying to show itself
VAR BetweenResult = SWITCH(TRUE();
isSubHeaderVisible =TRUE() && DisplayDetailCode = 0 ;BLANK();
CalcType=1 ;[Magic Additive Total];
CalcType=2 ;[Running Total];
CalcType=3 ;[Total Costs Actuals];
CalcType=4 ;FORMAT([% of Additive total];"0.0%");
CalcType=5 ; [Display Bookings & Backlog Actuals])
VAR Result = IFERROR(BetweenResult;BLANK())
RETURN Result
 
I've got the same measure for the budget value of total amount and I want to subtract those from each other. The error relates to the % shown under the calculated measure for gross margin % and operational result %. Is there a way to only subtract the numbers that are actually numbers and not % or is there some other way around this?
Many thanks in advance!
 
With kind regards, DLU
2 REPLIES 2
amitchandak
Super User
Super User

@DLU , seem like you are creating a measure slicer and want formatting based on measure

 

You have do it using calculation groups


https://www.sqlbi.com/blog/marco/2020/07/15/creating-calculation-groups-in-power-bi-desktop/

@amitchandak 

I don't know exactly what you mean with creating a measure slicer. I looked at the video you shared and Matt Allington also referred to calculation groups in his video to solve presenting values as %, but I'm not sure what I'm to do within the calculation groups. Is it, so I can format the shown value in % in tabular editor in stead of inside my measure and then it will be able to subtract within my measure? Is that it? I hope you can clarify this a little bit more so I know what I'm looking for. Many thanks in advance!

Gr. DLU

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.