Quantcast
Channel: Desktop topics
Viewing all articles
Browse latest Browse all 213819

Direct query and calculated column based on two tables

$
0
0

Hi

 

I hope you can help me with my challenge:

 

I have 2 direct query tables, that are connected with relation.

Table 1 is called orderdata having 2 columns: orderstatus and custorder. 

Table 2 is called salesdata and has 3 columns: shipdate, proddate and custorder (custorder is the relation link here)

 

I'm trying to create a calculated column which will work as follows (this syntax is more VBA than DAX, but that's where I feel more comfortable):

 

testcolumn1 = if(orderdata[orderstatus]<>"closed" and salesdata[proddate]=month(now()),"IN",if(orderdata[orderstatus]="closed" and salesdata[shipdate]=month(now),"IN",""))

 

testcolumn2=if(orderdata[orderstatus]<>"closed" and salesdata[proddate]<>month(now),"OUT","")

 

I hope it makes sense.

If this can't be done in powerbi, I'll just make it in ms access or sql, where the original data is located.

 

thanks in advance for any help

 

Marek


Viewing all articles
Browse latest Browse all 213819

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>