The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
Solved! Go to 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] ) ) )
Best Regards!
Dale
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])))
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
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.
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
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] ) ) )
Best Regards!
Dale
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