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

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

Reply
Purni55
New Member

Need to pull data from one column value with filter in another column value

I have three columns values say GrossSalesCY, EventDate and LastYearCorrespondingDate. Now, I have to create a new column called GrossSalesLY by getting the value from GrossSalesCY where LastYearCorrespondingDate = EventDate. 

 

Can someone please help with Dax?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Purni55 

Sorry for being so late to get back to you. Something might be missing from your Power BI Desktop. I'll send you the PBIX file, you can open it and see if there's anything wrong with the function. If you still have the above issues, I recommend that you upgrade your Power BI Desktop or reinstall it.

In PBIX, I've added a new measure, here is the DAX and preview:

GrossSalesLY Measure = 
CALCULATE(
    SUM('Table'[GrossSalesCY]),
    FILTER(
        ALL('Table'),
        'Table'[LastYearCorrespondingDate] = MAX('Table'[EventDate])
    )
)

vyohuamsft_0-1715065629015.png

 

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

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

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi, @Purni55 
Based on your information, I create a table:

vyohuamsft_0-1714705299431.png

 

Maybe you can create a new column and try the following DAX:

GrossSalesLY = 
CALCULATE(
    SUM('Table'[GrossSalesCY]),
    FILTER(
        ALL('Table'),
        'Table'[LastYearCorrespondingDate] = EARLIER('Table'[EventDate])
    )
)

Here is my preview:

 

vyohuamsft_1-1714705313655.png

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

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

 

Hi There, Thanks for the response. Yes I am looking for the same output. I have tried your DAX but it doesn't work with calculated column and throws error Calculate is not a function. 

 

Purni55_0-1714742260949.png

I have tried creating a Calculated Measure instead with same DAX but doesn't satisfy the output. Can you please provide me DAX for Calculated Measure?

 

Thanks

Anonymous
Not applicable

Hi, @Purni55 

Sorry for being so late to get back to you. Something might be missing from your Power BI Desktop. I'll send you the PBIX file, you can open it and see if there's anything wrong with the function. If you still have the above issues, I recommend that you upgrade your Power BI Desktop or reinstall it.

In PBIX, I've added a new measure, here is the DAX and preview:

GrossSalesLY Measure = 
CALCULATE(
    SUM('Table'[GrossSalesCY]),
    FILTER(
        ALL('Table'),
        'Table'[LastYearCorrespondingDate] = MAX('Table'[EventDate])
    )
)

vyohuamsft_0-1715065629015.png

 

 

How to Get Your Question Answered Quickly 

Best Regards

Yongkang Hua

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

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.