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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ljcrwfr1
Frequent Visitor

Need help with trying to exclude certain data past a particular date

I have a data set of CPT Procedure codes and I am looking to get the sum of their units but I want to exclude codes that contain 0503 after July 1, 2023. 

 

I tried using a cobination of dax formulas and I tried this formula but I dont think I used it correctly.

Measure =
CALCULATE(SUM('Appended Raw Data'[chg units sum]),
KEEPFILTERS( NOT 'Appended Raw Data'[proccode] =0503), 'Calendar'[Date] < DATE(2023,7,1))
1 ACCEPTED SOLUTION
qqqqqwwwweeerrr
Super User
Super User

Hi @ljcrwfr1 

 

If you could provide sample data that would be more handy for solving the problem. Here is my solution 

you can try this measure:
CALCULATE( SUM('Appended Raw Data'[chg units sum]), FILTER( 'Appended Raw Data', LEFT('Appended Raw Data'[proccode], 4) <> "0503" || 'Calendar'[Date] <= DATE(2023, 7, 1) ) )

 

this should work

 

Did I answer your question? if not please more details about data and problem statment
Mark my post as a solution! Appreciate your Kudos!!
Check for more intersing solution here: https://www.youtube.com/@letssolveproblem


Regards

 

View solution in original post

2 REPLIES 2
qqqqqwwwweeerrr
Super User
Super User

Hi @ljcrwfr1 

 

If you could provide sample data that would be more handy for solving the problem. Here is my solution 

you can try this measure:
CALCULATE( SUM('Appended Raw Data'[chg units sum]), FILTER( 'Appended Raw Data', LEFT('Appended Raw Data'[proccode], 4) <> "0503" || 'Calendar'[Date] <= DATE(2023, 7, 1) ) )

 

this should work

 

Did I answer your question? if not please more details about data and problem statment
Mark my post as a solution! Appreciate your Kudos!!
Check for more intersing solution here: https://www.youtube.com/@letssolveproblem


Regards

 

This worked! Thanks a million

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors