Forum Discussion

MRGMSR's avatar
MRGMSR
Icon for Helper I rankHelper I
4 years ago
Solved

Help with Multiple Table Measures with and without Aggregate

Hi,   I have been asked to develop a dashboard that shows data for different services when Month & Year is selected from a drop-down menu. The data comes from 7 different fact tables. I have connec...
  • Anonymous's avatar
    Anonymous
    4 years ago

    MRGMSR , what column in your 'Rail KPI Monthly' table holds the year and month? Is it the [Month] column? What format is that column? What you need to be able to do is have a column in 'Rail KPI Monthly' that can be mapped onto the corresponding month in 'Fiscal Calendar'. Let's assume that in both tables you have a YearMonth column that is in the format YYYYMM.

    I notice in the image of your data model that the relatinship between 'Fincal Calendar' and 'Rail KPI Monthly' is dotted, which means it is 'Inactive', so it will not affet how the measures work. The direction of the relationship is also the wrong way - normally you would have a relationship flowing from the Date dimension to the fact table. I assume you have not made the relationship active because there was no correct column to map between them, it that right?

     

    In any case, without changing the relationships, I think your [Rail MDBF] measure needs to be something like this:

     

    Rail MDBF =
       VAR vSelectedYYYYMM = SELECTEDVALUE('Fiscal Calendar'[YYYYMM])
       RETURN
          CALCULATE(
             AVERAGE('Rail KPI Monthly'[MDBF]),
             ALL('Rail KPI Monthly'),
             'Rail KPI Monthly'[YYYYMM] = vSelectedYYYYMM
          )

     

    It would help if you could also post a sample of the contents of the 'Rail KPI Monthly' file.