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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
vincentakatoh
Helper IV
Helper IV

HASONEVALUE, VALUES: A table of multiple values was supplied where a single value was expected.

Hi, 

 

Created below DAX but got above error message. Please help!

 

FirstPassQtyM = IF(HASONEVALUE(Data2[Station]), VALUES(Data2[FirstPassQty]))
InputFrM = IF(HASONEVALUE(Data2[Station]), VALUES(Data2[InputFr]))
FrPYWkM = IF(HASONEVALUE(Data2[station]), [FirstPassQtyM] / [InputFrM])

sample data

2017-11-04 22_01_48-Start.jpg

1 ACCEPTED SOLUTION

Hi @vincentakatoh,

 

Try this formula please.

 

Error3_Roll Yield 2 =
IF (
    HASONEVALUE ( data2[2Family] ),
    IF (
        HASONEVALUE ( data2[3Station] ),
        BLANK (),
        PRODUCTX (
            SUMMARIZE (
                'Data2',
                Data2[1Customer],
                'Data2'[2Family],
                'Data2'[3Station],
                "yield", DIVIDE ( SUM ( Data2[PassCount] ), SUM ( Data2[TotalCount] ), 0 )
            ),
            [yield]
        )
    )
)

HASONEVALUE, VALUE A table of multiple values was supplied where a single value was expected.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

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

View solution in original post

8 REPLIES 8
MattAllington
Community Champion
Community Champion

How about this

 

FrPYWkM = IF(HASONEVALUE(Data2[station]), divide(VALUES(Data2[FirstPassQty]) ,VALUES(Data2[InputFr])))

 

Or this

 

FrPYWkM =divide( SELECTEDVALUE(Data2[FirstPassQty]) , SELECTEDVALUE(Data2[InputFr])))



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

@MattAllington

 

Thanks for the response. And apologies for being a DAX dummy. Hope below can provide more clues. 

 

1) Error Msg: A table of multiple values was supplied where a single value was expected.

M_InputFr = IF(HASONEVALUE(Data2[station]), VALUES(Data2[InputFr]))

2) Error Msg: Cannot convert value 'Stationname' of type Text to type True/False.

M_FirstPassQty = IF(SELECTEDVALUE(Data2[station]), SELECTEDVALUE(Data2[FirstPassQty]))

3) No error msg. But some rows are missing in matrix

M_FirstPassQty = IF(HASONEVALUE(Data2[station]), SELECTEDVALUE(Data2[FirstPassQty]))

Hi @vincentakatoh,

 

These formulas could work but all depends on the source data.

M_InputFr = IF(HASONEVALUE(Data2[station]), VALUES(Data2[InputFr]))

If there are more than one value of [InputFr] of one station, this formula will throw an error.

The other two seem good.

Could you please provide a dummy pbix file?

 

 

Best Regards!

Dale

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

Hi @v-jiascu-msft

 

Attached please find my sample Pbix. Rename the 3x DAX that I having problem with

 

1. Error1_PassCount

2. Error2_TotalCount

3. Error3_RollYield

 

My goal is to achieve the same results, where "Error3_RollYield" = "RollYield_MyGoal". I believed my problemis due to column "FailDefectCode".

 

https://1drv.ms/u/s!ArjVwEnHONXNggEon7i3aTQQgX4-

 

 

 

 

I just looked at your file.  I do not see those error messages you describe appearing.



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Hi @MattAllington

 

Thanks again. Below screenshot shows the measures that are giving error messages. 

 

Most importantly, I wanted to calculate the roll yield (Yield= axbxc), but measure "Error3_Roll Yield" is returning a wrong result. Appreciate if you advice how to correct the DAX. 

 

https://1drv.ms/u/s!ArjVwEnHONXNggOxcaB99JSjzUrn

 

2017-11-07 08_31_06-HUA CL FrPY - Excel.jpg

Hi @vincentakatoh,

 

Try this formula please.

 

Error3_Roll Yield 2 =
IF (
    HASONEVALUE ( data2[2Family] ),
    IF (
        HASONEVALUE ( data2[3Station] ),
        BLANK (),
        PRODUCTX (
            SUMMARIZE (
                'Data2',
                Data2[1Customer],
                'Data2'[2Family],
                'Data2'[3Station],
                "yield", DIVIDE ( SUM ( Data2[PassCount] ), SUM ( Data2[TotalCount] ), 0 )
            ),
            [yield]
        )
    )
)

HASONEVALUE, VALUE A table of multiple values was supplied where a single value was expected.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

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

hi @v-jiascu-msft

Works like a charm! Thanks for solving this. This forum is really wonderful!

 

2 methods to calculate RollYield. By avoiding SummarizeColumns, also avoid errors when aggregating date->week->month. 

 

https://1drv.ms/u/s!ArjVwEnHONXNggfW2ETtdFOTf9Zx

 

Rgds, 

Vincent

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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