Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Dax measure to calculate difference between two sorted columns

Screenshot (72).png

For the table above, I am trying to create a measure that will find the difference between "% of Returns" for (Jan-1 to Apr-1) & "% of Returns" for (Apr-2 to Aug current date)

But the "% of Returns" is a measure

[

% of Returns = SUM('HJ REturns'[Return Quantity])/CALCULATE(SUM('Dispatch(CSV)'[QTY Pieces]),ALL('HJ REturns'[Reason Code]))

].

Tried many methods but wasn't able to find a solution, and am stuck in this case. It would be really helpful if anyone could help me with the solution.

 

Thank you in advance.

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

Try to add a date range to filter the % of Returns.

For example,

% of Returns for (Jan-1 to Apr-1) =
SUMX (
    FILTER (
        ALLSELECTED ( 'DateTable' ),
        [Date] >= DATE ( 2022, 1, 1 )
            && [Date] <= DATE ( 2022, 4, 1 )
    ),
    [% of Returns]
)

 

 

 

Best Regards,

Stephen Tao

 

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

Anonymous
Not applicable

Hi @Anonymous,

Screenshot (80).png

 I tried this solution but it doesn't seem to work. It returns a value greater than the value expected.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.