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
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

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.

@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.

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
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.