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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Krishna_Newuser
Frequent Visitor

% Calculation from one table to another

Hello,

I need to copy the % from another table to current table, can you help me to it. 

 Table 1 has value of 7 columns or 3 Columns, 2 Columns where are Table 2 has 7 columns, i just need to place the percentage from Table 1 to Table 2.   I have used this DAX but didn't help.

 

Store Name-SH =
VAR _Domain =
CALCULATE(
FIRSTNONBLANK('04_StoreConsoDaily'[NewAdoption],1),
FILTER(ALL('04_StoreConsoDaily'),'04_StoreConsoDaily'[TxnDt]='CHeck'[TxnDt])
)
RETURN
IF(_Domain = BLANK(),0,_Domain)


 Table 1:

StoreName

Store Num

TxnDt

Percentage

Mayflower Basildon SF

11

17-Mar

10%

Mayflower Basildon SF

11

18-Mar

10%

Mayflower Basildon SF

11

19-Mar

10%

Mayflower Basildon SF

11

20-Mar

10%

Mayflower Basildon SF

11

21-Mar

10%

Mayflower Basildon SF

11

22-Mar

10%

Mayflower Basildon SF

11

23-Mar

10%

Crownhill Plymouth SF

112

17-Mar

20%

Crownhill Plymouth SF

112

18-Mar

20%

Crownhill Plymouth SF

112

19-Mar

20%

Crownhill Plymouth SF

112

20-Mar

20%

Crownhill Plymouth SF

112

21-Mar

30%

Leigh SF

113

17-Mar

20%

Leigh SF

113

18-Mar

20%

Leigh SF

113

19-Mar

30%

Leigh SF

113

20-Mar

40%

 

Table 2: 

StoreName

Store Num

TxnDt

Mayflower Basildon SF

11

17-Mar

Mayflower Basildon SF

11

18-Mar

Mayflower Basildon SF

11

19-Mar

Mayflower Basildon SF

11

20-Mar

Mayflower Basildon SF

11

21-Mar

Mayflower Basildon SF

11

22-Mar

Mayflower Basildon SF

11

23-Mar

Crownhill Plymouth SF

112

17-Mar

Crownhill Plymouth SF

112

18-Mar

Crownhill Plymouth SF

112

19-Mar

Crownhill Plymouth SF

112

20-Mar

Crownhill Plymouth SF

112

21-Mar

Crownhill Plymouth SF

112

22-Mar

Crownhill Plymouth SF

112

23-Mar

 

Expected Result:

 

StoreName

Store Num

TxnDt

Percentage

Mayflower Basildon SF

11

17-Mar

10%

Mayflower Basildon SF

11

18-Mar

10%

Mayflower Basildon SF

11

19-Mar

10%

Mayflower Basildon SF

11

20-Mar

10%

Mayflower Basildon SF

11

21-Mar

10%

Mayflower Basildon SF

11

22-Mar

10%

Mayflower Basildon SF

11

23-Mar

10%

Crownhill Plymouth SF

112

17-Mar

20%

Crownhill Plymouth SF

112

18-Mar

20%

Crownhill Plymouth SF

112

19-Mar

20%

Crownhill Plymouth SF

112

20-Mar

20%

Crownhill Plymouth SF

112

21-Mar

0%

Crownhill Plymouth SF

112

22-Mar

0%

Crownhill Plymouth SF

112

23-Mar

0%

Leigh SF

113

17-Mar

20%

Leigh SF

113

18-Mar

20%

Leigh SF

113

19-Mar

30%

Leigh SF

113

20-Mar

0%

Leigh SF

113

21-Mar

0%

Leigh SF

113

22-Mar

0%

Leigh SF

113

23-Mar

0%

1 ACCEPTED SOLUTION

Hi @TomMartens

Sorry, all my Gmail, One Drive, Dropbox or any other applications are restricted here.  I don't have provisions to sign in to any of the applications. 
As i updated in the 1st chat, is there any possible that can be done here. 
 

View solution in original post

4 REPLIES 4
TomMartens
Super User
Super User

Hey @Krishna_Newuser ,

 

I recommend using the DAX function LOOKUPVALUE to create a calculated column in Table2. This article explain the intricate workings of the function: https://dax.guide/lookupvalue/

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hi @TomMartens 
Thank you for the reply.

I tried this one, 
Store Name-SH =
VAR _Sample = SAMPLE(10, '04_StoreConsoDaily', '04_StoreConsoDaily'[StoreNo])
RETURN
ADDCOLUMNS(
SUMMARIZE(_Sample, '04_StoreConsoDaily'[TxnDt], '04_StoreConsoDaily'[NewAdoption]),
"New Adoption",
VAR TxnDt = '04_StoreConsoDaily'[TxnDt]
VAR RefrenceYear = 2024
Var _CheckTxnDt =
LOOKUPVALUE(CHeck[TxnDt], CHeck[StoreNo], CHeck[TxnDt], 0)
RETURN
_CheckTxnDt) 

Error received as "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value".

Hey @Krishna_Newuser ,

 

consider creating a pbix that contains sample data. Upload the pbix to OneDrive, Google Drive, or dropbox and share the link. If you are using Excel to create the sample data instead of the manual input method share the spreadsheet as well.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hi @TomMartens

Sorry, all my Gmail, One Drive, Dropbox or any other applications are restricted here.  I don't have provisions to sign in to any of the applications. 
As i updated in the 1st chat, is there any possible that can be done here. 
 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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