Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Pull data from one table to another without relationship

My report will refresh every Monday (Only) which will have the previous week data (27th Oct to 2nd Nov).  I have two tables where I need to copy the data from one table to another. Note: There is no relation between these two tables.

Need to take the values of PTT column from Walkie Talkie usage Table to Adoption Average Table.
PTT showed using the below Measure in the Walkie Talkie Usage,

PTT =

Var A = CALCULATE (DISTINCTCOUNT (WalkieTalkieUsage [Conversation]))

Var B = CALCULATE (COUNT ('Select Store'[Store No]), ALL('00_SelectDateRange'[Day]))

RETURN

A/B

 

When I try to pull the PPT to Adoption Average using the below measure, its pulling only 40+ records, original data available is 502. Please help on this.

PPF = LOOKUPVALUE(Adoption_Average[StoreNo], Adoption_Average[StoreNo], WalkieTalkieUsage[PTT])

 

Adoption_Average

StoreNoStore NameTxn DateAdoption %P2T
1AA27-10--2024100%502
2AB27-10--2024972011
3AC27-10--202498532
4BB27-10--2024552945
5CC27-10--20246634
6DD27-10--2024772089
7EE27-10--202444509
8RR27-10--202493358
9TT27-10--202489554
10GG27-10--2024551047
12HH27-10--2024332797
312II27-10--202467444

 

 

StoreNoStore NameTxn DetailsAdoption %P2T
1AA27-10--2024100%502
2AB27-10--2024972011
3AC27-10--202498532
4BB27-10--2024552945
5CC27-10--20246634
6DD27-10--2024772089
7EE27-10--202444509
8RR27-10--202493358
9TT27-10--202489554
10GG27-10--2024551047
12HH27-10--2024332797
13II27-10--202467444
14NN27-10--2024100333
15RT27-10--202455509
16FG27-10--202433358
17ERT27-10--202467554
18FWZ27-10--202477358
19YU27-10--202444359
20TBN27-10--202493360
21FEV27-10--202489361

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Anonymous 

     

    Ensure that the relationship between the two tables is properly established.

     

     

    Try this:

     

    Create a column.

     

    Unique Conversation ID Count 1 = 
    CALCULATE(
        DISTINCTCOUNT('Table 1'[Conversation ID]),
        ALLEXCEPT('Table 1', 'Table 1'[Store No])
        
    )

     

    or

     

    Unique Conversation ID Count 2 = 
    CALCULATE(
        DISTINCTCOUNT('Table 1'[Conversation ID]),
        FILTER(
            ALL('Table 1'),
            'Table 1'[Store No] = EARLIER('Table 1'[Store No])
        )
    )

     

    Here is the result.

     

     

    Regards,

    Nono Chen

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

     

8 Replies

  • Hi Anonymous,

    In Power BI, pulling data between tables without relationships, especially when there’s a mismatch in record count, can be challenging. To achieve this more reliably, consider the following approach that uses aggregation instead of LOOKUPVALUE, which may only retrieve a partial set due to its single-value constraint.

    Solution: Using a Calculated Measure in Adoption Average

    To bring over the PTT calculation, create a measure in the Adoption Average table that references the Walkie Talkie Usage table.

    • Define PTT Calculation: Ensure your original PTT measure is correct in the Walkie Talkie Usage table:

      DAX
      Copy code
      PTT =
      VAR A = CALCULATE(DISTINCTCOUNT(WalkieTalkieUsage[Conversation]))
      VAR B = CALCULATE(COUNT('Select Store'[Store No]), ALL('00_SelectDateRange'[Day]))
      RETURN A / B
    • Create a New Measure in the Adoption Average Table: Use this measure to bring over the PTT calculation without LOOKUPVALUE.

      DAX
      Copy code
      PTT_In_AdoptionAverage =
      CALCULATE(
          [PTT],
          ALL('Adoption Average')  -- This removes row context filtering in Adoption Average
      )
      • This formula calculates PTT as defined in Walkie Talkie Usage and makes it available in Adoption Average without filtering down to individual rows.
      • Note: Replace [PTT] with the fully qualified name if your PTT measure isn’t directly referenced.
    • Map Results to Store No, if Required: If your goal is to calculate PTT based on each StoreNo or match both tables more granularly, consider creating a table or matrix visualization to show PTT alongside Adoption Average based on common attributes like StoreNo.

    Troubleshooting if the Above Fails

    If CALCULATE doesn’t yield the full record set, test if cross-joining StoreNo with PTT values from both tables in a calculated table can help instead. Let me know if you'd like details on that approach.

    If I have resolved your question, please consider marking my post as a solution. Thank you!

  • Hi Anonymous ,

     

    Can you please share some sample data and expected output. it will be helpful for us to solve your query in short time and in right way.

     

    Thanks,

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

     

    Thank you very much Ankur04 and grazitti_sapna for your prompt reply.

     

    For your question, here is the method I provided:

     

    Here's some dummy data

     

    “Adoption Average”

     

     

     

    Make sure you have calculated the PTT in the Walkie Talkie Usage table. you can use your previous DAX formulas.

     

    PTT =
    Var A = CALCULATE (DISTINCTCOUNT (WalkieTalkieUsage [Conversation]))
    Var B = CALCULATE (COUNT ('Select Store'[Store No]), ALL('00_SelectDateRange'[Day]))
    RETURN
    A/B

     

    Please create a measure and I modified your code:

     

    Adoption_PTT = 
    AVERAGEX(
        FILTER('Walkie Talkie Usage', 'Walkie Talkie Usage'[StoreNo] = SELECTEDVALUE('Adoption Average'[StoreNo])
        ),
        'Walkie Talkie Usage'[PTT]
    )

     

    Here is the result.

     

     

    Regards,

    Nono Chen

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

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Anonymous ,
      Thank you for the reply!!!
      We could see that count is entirely mismatches, from your screenshot for Store No 1 - count for P2T  is 502 but Adoption_PTT is 0.65. Can you help on this. 

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous 

         

        Can you share the pbix file? As well as your expected results, take care to remove the sensitivity interest.

         

        Regards,

        Nono Chen

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