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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
davidibi4524
Frequent Visitor

need help

hi everyone

I need to look for the same part name according to the order date between the order date and + 3 days more spare

davidibi4524_2-1628778698559.png

for exaple: the first line on the order table with part name A-123 maching to the first line on the invoice table because the date is in the range of 13/08/2021 + 3 (between 13/08/2021 and 16/08/2021)

can someone help me find the right dax formula to build the desired table?

thanks :))

 

 

6 REPLIES 6
v-angzheng-msft
Community Support
Community Support

Hi,  @davidibi4524 

 

Why does A-456 match the invoice quantity of 2000, and isn't the part name of the invoice quantity of 2000

A-123? Am I missing something?

vangzhengmsft_0-1629096698193.png

 

 

Best Regards,
Community Support Team _ Zeon Zheng

Ashish_Mathur
Super User
Super User

Hi,

I suggest that you write a calculated column formula in the Orders table.  Are you interested in that solution (instead of a measure)?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Community Champion
Community Champion

@davidibi4524 Maybe:

Measure = 
  VAR __PartName = MAX('ORDERS'[part name])
  VAR __MinDate = MAX('ORDERS'[date])
  VAR __MaxDate = __MinDate + 3
  VAR __Table = FILTER('INVOICES',[part name]=__PartName && [date] >= __MinDate && [date]<=__MaxDate)
RETURN
  SUMX(__Table,[quantity])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

i can't sum this measure..

what i can do?

@davidibi4524 Well, measure aggregation is a slightly different topic. See my blog article about that here: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149

The pattern is:
MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])
etc.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

going to try it

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors