Forum Discussion

Kannan4444's avatar
Kannan4444
Helper I
1 year ago
Solved

Export and Import

Hey Guys, 
i have below data and trying to achieve Export (based on load date) and Import (based on discharge date)

If i select one country, i need to show the Net exports as below.

 

Please HELP!!!



Truck KT ProductLoad_PortLoadCountryLoadSubregionLoadRegionLoadDateDischarge_PortDischargeCountryDischargeSubregionDischargeRegionDischargeDate
Truck1                      8WaterVasilikoCyprusMedMed26-Jul-24BurgasBulgariaMedMed09-Aug-24
Truck2                      8PetrolEleusisGreeceMedMed30-Jul-24Exxon AntwerpBelgiumNW EuropeNW Europe13-Aug-24
Truck3                      8DieselAugustaItalyMedMed08-Aug-24Santa PanagiaItalyMedMed22-Aug-24
Truck4                    10WaterUst LugaRussian FederationBalticsFSU+Russia10-Aug-24MarsaxlokkMaltaMedMed24-Aug-24
Truck5                      5PetrolUst LugaRussian FederationBalticsFSU+Russia17-Aug-24Ust LugaRussian FederationBalticsFSU+Russia31-Aug-24
Truck6                      6DieselArkhangelskRussian FederationOther FSU+RussiaFSU+Russia26-Aug-24Unknown-MedUnknownMedMed09-Sep-24
Truck7                    17WaterDortyolRepublic of TurkiyeMedMed03-Sep-24RotterdamNetherlandsNW EuropeNW Europe17-Sep-24
Truck8                      8PetrolUnknown-SpainSpainMedMed09-Sep-24Unknown-US PADD 1United States of AmericaUS PADD 1United States Region23-Sep-24
Truck9                    10DieselExxon AntwerpBelgiumNW EuropeNW Europe10-Sep-24New YorkUnited States of AmericaUS PADD 1United States Region24-Sep-24
Truck10                      8WaterBurgasBulgariaMedMed12-Sep-24VasilikoCyprusMedMed26-Sep-24
Truck11                    10PetrolExxon AntwerpBelgiumNW EuropeNW Europe14-Sep-24EleusisGreeceMedMed28-Sep-24
Truck12                      7DieselSanta PanagiaItalyMedMed15-Sep-24AugustaItalyMedMed29-Sep-24
  • Hi Kannan4444 

     

    Create a date/calendar table, link in my bio.

     

    Create an Active One to Many Relationship from the Date Table date column with the Load Date and do the same for the Discharge Date, but this will be an in-active relationship

     

    Create a measure for LoadDate

    KT Load Date = SUM('Table'[KT])

    Then another for Discharge Date

    KT Discharge Date = CALCULATE(SUM('Table'[KT]), USERELATIONSHIP('Date'[Date], 'Table'[Discharge Date])

     

    When creating any visuals with date inforation, use the columns from the Date table and add the measures to the visuals to be able to compare.

     

    Hope this helps

    Joe

1 Reply

  • Joe_Barry's avatar
    Joe_Barry
    Solution Sage

    Hi Kannan4444 

     

    Create a date/calendar table, link in my bio.

     

    Create an Active One to Many Relationship from the Date Table date column with the Load Date and do the same for the Discharge Date, but this will be an in-active relationship

     

    Create a measure for LoadDate

    KT Load Date = SUM('Table'[KT])

    Then another for Discharge Date

    KT Discharge Date = CALCULATE(SUM('Table'[KT]), USERELATIONSHIP('Date'[Date], 'Table'[Discharge Date])

     

    When creating any visuals with date inforation, use the columns from the Date table and add the measures to the visuals to be able to compare.

     

    Hope this helps

    Joe