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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Syndicate_Admin
Administrator
Administrator

Min give error due to blank or empty value

Hello, I have follow measure, that works well with most part of values, but it shows error in some cases.

if(values(Mastermaterialsap[DChain-spec.])="E51",Measurement[Total months available],min(MIN(min(SEM1,SEM2),MIN(SEM3,SEM4)),SEMAF2))
I suspect that the cases when gives an error is because the result of variable SEM1,SEM2,SEM3 or SEM4 is empty or blank. Can you help me to solve that in case error in the measure if gives 0, or to correct the MIN part of the measure?
many thanks
sonia
1 ACCEPTED SOLUTION
Syndicate_Admin
Administrator
Administrator

Finally if it has worked. Thanks a lot

View solution in original post

9 REPLIES 9
Syndicate_Admin
Administrator
Administrator

Finally if it has worked. Thanks a lot

mahenkj2
Solution Sage
Solution Sage

Hi @Syndicate_Admin ,

 

The description of error "A table of several values was provided where a single value was expected." indicate that sometime result of one of your condition of if statement is retruning more than one value in evaluating expression, and as you say it is not happening all the time but with certain values/data, then can you please look at that data for both condition of your if statement. Else please share some data sample here.

 

Hope it helps!

mahenkj2
Solution Sage
Solution Sage

@

Syndicate_Admin
Administrator
Administrator

Hello, no. It has not yet been resolved. I've tried the indicated but it doesn't work. Any more ideas? Thank you

pls try this

=If(values(Mastermaterialsap[DChain-spec.])="E51",
Measurement[Total months available],
MINX(
{ SEM1,SEM2,SEM3,SEM4,SEMAF2},[Value])
)

if this does not help you, then we need to look at your file

Syndicate_Admin
Administrator
Administrator

Hello the data type is the same. It happens that with most row elements it represents the value well. It only gives error in some elements and that is why when all the elements are selected it gives this error

SoniaGo_0-1685689360274.png

Error Message:
MdxScript(Model) (711, 6) Calculation error in measurement 'Measures'[Semaphore 5monthsATW/CM]: A table of several values was provided where a single value was expected.

and I get the feeling that it gives conflict in the values that do not have data in some months, and therefore the MIN does not calculate well.

Thank you

sonia

Ahmedx
Super User
Super User

I think you have an error because the type of data you get with measure is different but this power bi doesn't support.
write like this

= if(
     values(Mastermaterialsap[DChain-spec.])="E51",
            Measurement[Totalmonthsavailable]&"",
                   min(MIN(min(SEM1,SEM2),MIN(SEM3,SEM4)),SEMAF2)&""
)
Syndicate_Admin
Administrator
Administrator

Hello thank you very much. If you already try if error and coalesce, but it does not work, the representation in an object continues to fail for any of the values. Thank you

DOLEARY85
Resident Rockstar
Resident Rockstar

Hi,

 

if i've understood correctly you want to replace the error with 0.

 

you could try:

 

IFERROR( Your measure , 0)
 
or
 
COALESCE( Your measure , 0 )
 
If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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