Forum Discussion

jbstephenson's avatar
jbstephenson
New Member
3 years ago
Solved

Create calculated column in Table2 that can be sliced using fields from Table1

My objective is to be able to create a visual (a column chart) with Table2[Arbitrary date] as the X-axis and the Table2[Calculated column] as the Y-axis. I need to be able to have this chart affected by slicers from Table1. For example, the calculated column in Table2 should change values when Table1[color] is used as a slicer and "Yellow" is selected. Everything I've researched indicates that a relationship is required (maybe that's not the case), but I don't know how one could create a relationship between the two tables that accomplished my objective. 

 

 

Here is an example Table1:

 

Serial numberLocationProduct typeColorDate receivedDate processedDate shipped
101TXUsedBlack10/1/202210/31/202211/30/2022
102TXNewBrown10/2/202211/1/202212/1/2022
103TXRefurbishedYellow10/3/202211/2/202212/2/2022
104TXUsedPink10/4/202211/3/202212/3/2022
105TXNewBlack10/5/202211/4/202212/4/2022
106ARRefurbishedBrown10/6/202211/5/202212/5/2022
107ARUsedYellow10/1/202210/31/202211/30/2022
108ARNewPink10/2/202211/1/202212/1/2022
109ARRefurbishedBlack10/3/202211/2/202212/2/2022
110ARUsedBrown10/4/202211/3/202212/3/2022
111ARNewYellow10/5/202211/4/202212/4/2022
112ARRefurbishedPink10/6/202211/5/2022

12/5/2022

 

Here is an example Table2, column "Calculated column" being the crux of my question:

 

Arbitrary dateCalculated column
10/2/2022=calculate(…
10/9/2022=calculate(…
10/16/2022=calculate(…

 

Here is what I've tried (with no success) for the calculated column:

 

=calculate( count(table1[serial number]) ,table1[date received] > table2[arbitrary date], table1[date processed] > table2[arbitrary date] )

 

 

  • MFelix's avatar
    MFelix
    3 years ago

    Hi jbstephenson,

     

    I'm this case you need to create a measure to make the calculation dinamically try the following.

     

    Measure =

    =countrows(FILTER(table1 ,table1[date received] >MAX( table2[arbitrary date]) & & table1[date processed] > MAX( table2[arbitrary date] )) 

4 Replies