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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors