Forum Discussion

jacinto's avatar
jacinto
Frequent Visitor
3 years ago
Solved

Valid measure for two fact tables

Hi all,   I have two fact tables that couldn't be merged.  The following is dummy data and sample content. The Main table contain most of the data, however, I have also small table with extra infor...
  • bolfri's avatar
    bolfri
    3 years ago

    dim_item

    dim_item = 
    DISTINCT(
        UNION(
            GROUPBY('202120','202120'[item]),
            GROUPBY(factor,factor[item]),
            GROUPBY(main,main[item])
        )
    )

     

    dim_origin

    dim_origin = 
    DISTINCT(
        UNION(
            GROUPBY('202120','202120'[origin]),
            GROUPBY(factor,factor[origin])
        )
    )

     

    dim_year

    dim_year = 
    DISTINCT(
        UNION(
            GROUPBY('202120','202120'[year]),
            GROUPBY(main,main[year])
        )
    )

    Relationship

     

    Volume Sold = SUM('202120'[volume ])
    Emmision =
    SUMX(
        SUMMARIZE(
            factor,
            dim_item[item],
            factor[factor],
            dim_origin[origin],
            "VolumeForFactor",[Volume Sold]
        ),
        [VolumeForFactor]*factor[factor]
    )
     
    Result: