Forum Discussion

JOKA's avatar
JOKA
Advocate I
6 years ago
Solved

SLICER AS A FILTER FOR DATA TABLE

Hi   I need help with dax. I have three tables: - a calendar table - a data table (fact table) - a table with ratios   The ratios table is as follows:  Date Date Analysis Ratio Jan-20...
  • v-zhenbw-msft's avatar
    6 years ago

    Hi JOKA ,

     

    We can create a measure to meet your requirement.

    1. Create the relationships like following screenshot.

     

     

    2. Then we can create a measure like this,

     

    Indicator Total correct = 
    IF (
        HASONEFILTER ( 'Fact Table'[Date] ) || HASONEFILTER ( 'Table'[Date] ),
        SUM ( 'Fact Table'[Metric] ) * SUM ( 'Table'[Ratio] ),
        SUMX (
            SUMMARIZE (
                'Fact Table',
                'Fact Table'[Date],
                'Fact Table'[Metric],
                "product", 'Fact Table'[Metric] * CALCULATE(SUM('Table'[Ratio]))
            ),
            [product]
        )
    )

     

     

     

    If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

     

    Best regards,

     

    Community Support Team _ zhenbw

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    BTW, pbix as attached.