Forum Discussion

rkCam's avatar
rkCam
Frequent Visitor
3 years ago
Solved

Date Slicer not working with calculated groups where calculation item placed under Date field column

Scenario :  Matrix with multiple measures on rows and Calculation groups on columns. Calculated group item def : Value=CALCULATE( SELECTEDMEASURE(), USERELATIONSHIP( DateDim[Date], 'ShipmentA...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi rkCam 

    You can refer to the folloing measure

    Value =
    CALCULATE (
        SELECTEDMEASURE (),
        FILTER (
            'ShipmentAnalysis-LineLevel',
            [item_fulfillment_date] IN VALUES ( DateDim[Date] )
        )
    )
    
    %Total =
    CALCULATE (
        SWITCH (
            TRUE (),
            SELECTEDMEASURE () = "Total Order Lines", BLANK (),
            SELECTEDMEASURE () = "Total Revenue", BLANK (),
            FORMAT ( DIVIDE ( SELECTEDMEASURE (), [Total Order Lines] ), "0%" )
        ),
        FILTER (
            'ShipmentAnalysis-LineLevel',
            [item_fulfillment_date] IN VALUES ( DateDim[Date] )
        )
    )
    

    Best Regards!

    Yolo Zhu

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