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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
NathanV8
Frequent Visitor

Error - A Table of multiple values was supplied where a single value was expected.

Hello Brainstrust, 

I would like some assistance to figure out a report I am trying to fix. 

In this report, I am connected to x2 seperate data sources to calculate a total fuel burn, 

Majority of the data comes from the Fuel Data with me calculating "Bunkered Fuel" (Fuel taken onboard) in a seprate query, 

I am running into an issue when i am trying to have have visuals work correctly. 

I have a measure that adds the bunkered fuel to the equation because wihtout it shows negatives when that is actually accurate 

See below images 

Image 1: Shows the data as it is Intended but the fuel bunkered doesnt showup -> because of the relationship (If i removed the master date table relationship it shows up but breaks the other visuals as seen in Image 2 

NathanV8_1-1707812161356.png


Image 2: Shows the data report view after I have removed the relation between the master date table and the fuel bunkered table 
Image 3: shows the error I get when i view the "See Details" 

NathanV8_2-1707812234518.png


NathanV8_0-1707811787488.png


Image 4: Shows the Measure IN question in the error 
Image 5: Show the master measure that uses that measure to calculate it all 

NathanV8_3-1707812336672.pngNathanV8_4-1707812359101.png



Image 6 & 7:  shows the realtionship with & without the connection between Fuel Bunkered table 

NathanV8_5-1707812438179.pngNathanV8_6-1707812461900.png


I am suspecting ti has something to do with the fact my data has date with time involved but I need that granualrity, wher emy date table doesnt have tiime functions, I havent been able to see a good Date & Time master table or even a way to connect a master time table to a master table if they need to be seperate. 

I am just generally stumped on this one and hoping omeone can assist me in my venbtures to fix this one. 

3 REPLIES 3
NathanV8
Frequent Visitor

Can anyone help me with this one im still pretty stumped on this one... 

v-yilong-msft
Community Support
Community Support

Hi @NathanV8 ,

For the information you provided, I noticed something in Image 3. In response to the information you provided, I noticed in Image 3 that the error here is primarily due to a computational error in the metric called "TSA_FuelBunkered_DATA[Total Bunkered 2]", which is preventing the data from being loaded. Specifically, the metric expects to receive a single value, but instead provides multiple values, hence the problem.

 

In Image 5, when calculating "Total Bunkered 2", you are using the VALUES function, which is used to get a unique value in context, but when you want to get more than one value in the metric, you can use the SUMX function.

 

I think you can modify the DAX code as follows.

Total Bunkered 2 = 
SUMX (
    VALUES ( 'TSA_FuelBunkered_DATA'[Date Adjustment] ),
    CALCULATE (
        SUM ( 'TSA_FuelBunkered_DATA'[Amount (Litres)] ),
        'TSA_FuelBunkered_DATA'[Asset Name] = VALUES ( 'TSA_FuelBunkered_DATA'[Asset Name] )
    )
)

 

 

Best Regards

Yilong Zhou

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

Hello @v-yilong-msft 

I made thabove change a syou suggested but i think has adjusted the actual calculation instead + fuel bunkered mesure 

NathanV8_0-1708312106399.png


I use the below Measure to get the line grapgh 

Difference Fuel ROB Measure + Fuel = 
VAR CurrentFuelROB = MAX(TSA_Fuel_DATA[Fuel ROB Readings])
VAR CurrentAsset = MAX(TSA_Fuel_DATA[Asset Name])
VAR CurrentIndex = MAX(TSA_Fuel_DATA[Reading Rank])
VAR PreviousFuelROB = 
    CALCULATE(
        MAX(TSA_Fuel_DATA[Fuel ROB Readings]),
        FILTER(
            ALL(TSA_Fuel_DATA),
            TSA_Fuel_DATA[Asset Name] = CurrentAsset &&
            TSA_Fuel_DATA[Reading Rank] = CurrentIndex - 1
        )
    )
RETURN
    IF(
        NOT(ISBLANK(PreviousFuelROB)),
        PreviousFuelROB - CurrentFuelROB + [Total Bunkered 2],
        BLANK()
    )


In conjunction with the new Fuel Bunkered measure adjustment 

Total Bunkered 2 = 
SUMX(
    VALUES ( 'TSA_FuelBunkered_DATA'[Date Adjustment] ),
    CALCULATE (
        SUM ( 'TSA_FuelBunkered_DATA'[Amount (Litres)] ),
        'TSA_FuelBunkered_DATA'[Asset Name] = VALUES ( 'TSA_FuelBunkered_DATA'[Asset Name] )
    )
)


My verification collumns seem to be working though which has me stumped wits putting the together that i stumping the equation 

NathanV8_1-1708312337325.pngNathanV8_2-1708312365026.png


Anywher ein the second image where there is a negative number the fuel bunkered should make that a positive number again based on the calculations 



Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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