Forum Discussion

wvdmpowerbi's avatar
wvdmpowerbi
Regular Visitor
7 years ago
Solved

Calculate and merge between tables

Hi

 

See attached the following screenshot.

 

The information is from 2 tables:

 

Table 1 - Generation:

IntervalStart

IntervalValue

 

Table 2 - NIM:

NMI

UOM

RegisterID





 

I would like to put a formula in that says:

 

IF RegisterID = "E1", then make the corresponding IntervalValue date negative by multiplying by -1

 

I also would like to consolidate or SUM where data in NMI column is = "7102000057", "7102000058", & "7102000059",





Thanks

 

  • Hi wvdmpowerbi ,

     


    IF RegisterID = "E1", then make the corresponding IntervalValue date negative by multiplying by -1

     


    To create a calculated column as below.

    Column = IF('Table'[RegisterID]="E1",'Table'[IntervalValue]*-1)

     


    I also would like to consolidate or SUM where data in NMI column is = "7102000057", "7102000058", & "7102000059",

     


    For the request, what did you want? A measure of a calculated table?

    Measure:

    Measure = CALCULATE(SUM('Table'[Column]),FILTER('Table','Table'[NIMI]=7102000057 || 'Table'[NIMI]=7102000058 || 'Table'[NIMI]=7102000059))

    Table:

    filter table = FILTER('Table','Table'[NIMI]=7102000057 || 'Table'[NIMI]=7102000058 || 'Table'[NIMI]=7102000059)

    If it doesn't meet your requirement, kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

     

    BTW, Pbix as attached.

     

     

7 Replies

  • Mariusz's avatar
    Mariusz
    Icon for Community Champion rankCommunity Champion

    Hi wvdmpowerbi 

     

    Can you provide a useable sample?


    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    Mariusz Repczynski



     

     

      • Mariusz's avatar
        Mariusz
        Icon for Community Champion rankCommunity Champion

        Hi wvdmedify 

         

        Please see the below.

         

        Best Regards,
        Mariusz

        If this post helps, then please consider Accepting it as the solution.

        Please feel free to connect with me.
        Mariusz Repczynski

         

  • v-frfei-msft's avatar
    v-frfei-msft
    Icon for Community Support rankCommunity Support

    Hi wvdmpowerbi ,

     


    IF RegisterID = "E1", then make the corresponding IntervalValue date negative by multiplying by -1

     


    To create a calculated column as below.

    Column = IF('Table'[RegisterID]="E1",'Table'[IntervalValue]*-1)

     


    I also would like to consolidate or SUM where data in NMI column is = "7102000057", "7102000058", & "7102000059",

     


    For the request, what did you want? A measure of a calculated table?

    Measure:

    Measure = CALCULATE(SUM('Table'[Column]),FILTER('Table','Table'[NIMI]=7102000057 || 'Table'[NIMI]=7102000058 || 'Table'[NIMI]=7102000059))

    Table:

    filter table = FILTER('Table','Table'[NIMI]=7102000057 || 'Table'[NIMI]=7102000058 || 'Table'[NIMI]=7102000059)

    If it doesn't meet your requirement, kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

     

    BTW, Pbix as attached.