Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Comparing two Tables working but extremely slow

Hi.  

 

I have my compare function working when comparing two different tables but it way to slow to release to any end user.

 

I am comparing Data_POG metrics vs Data_Performance metrics in two different tables.  Both tables are tied to a Product List and a Store List.

 

 

 

I need to know if they if they match..if they are the same, or less, or more.  The file is about 60K so it is not the file size.  I believe it is how I am using dax formulas.

 

 

Here is an example of how I am getting to the "Less" caclulation in the Post Files.  I do the same calculation for the Pre and compare them. 

Should I combine the tables and then redo the dax formulas?  Append and then group by?  Thanks for any help on how to layout this database or redo calculations to improve speed.

--------------

 

Post $ Sales - Less:=VAR PreFilter = [Pre_Filter]

VAR PostFilter = [Post_Filter]

RETURN

SUMX (

SUMMARIZE ( Data_POG, KGR_PROD_MSTR[Base UPC],KGR_STR_MSTR[DivStr] ),

VAR PreCheck =

CALCULATE (

CALCULATE (

[Ttl Capacity],

FILTER ( VALUES ( Data_POG[Relay] ), Data_POG[Relay] = PreFilter )

)

)

VAR PostCheck =

CALCULATE (

CALCULATE (

[Ttl Capacity],

FILTER ( VALUES ( Data_POG[Relay] ), Data_POG[Relay] = PostFilter )

)

)

VAR PostVel =

CALCULATE (

CALCULATE (

[$ Vel],

FILTER ( VALUES ( Data_Perf[Relay] ), Data_Perf[Relay] = PostFilter )

)

)

RETURN

IF (

PostCheck > 0

&& PostCheck < PreCheck

&& PreCheck <> BLANK (),

PostVel,

BLANK ()

)

)

  • What are your criteria for "match"?

     

    Usually you compare via INTERSECT and/or EXCEPT.

2 Replies

  • What are your criteria for "match"?

     

    Usually you compare via INTERSECT and/or EXCEPT.