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
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
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"
Image 4: Shows the Measure IN question in the error
Image 5: Show the master measure that uses that measure to calculate it all
Image 6 & 7: shows the realtionship with & without the connection between Fuel Bunkered table
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.
Can anyone help me with this one im still pretty stumped on this one...
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
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
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
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
110 | |
97 | |
93 | |
87 | |
68 |
User | Count |
---|---|
173 | |
134 | |
132 | |
102 | |
95 |