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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

DAX Query - Help

Hi Team,

 

Need one help in formulating DAX query, Below is the sample data

CARGO_SEQNOTendered_DateShip DateLocation Code
29306171612021-05-042021-05-06    005
29306178552021-05-042021-05-11    005
29305184912021-05-062021-05-10    006
29306613532021-05-062021-05-12    005
29306612212021-05-062021-05-13    005
29306736552021-05-062021-05-07    007
29306616152021-05-072021-05-12    007
29307744792021-05-062021-05-16    006
29307275762021-05-082021-05-17    006

 

Requirement is to find the count of Cargo_Seqno that were Tendered prior to a given date but were shipped after that date from the same location code

 

For example using the below query i can get total 3 units tht were tendered prior to 9th May 2021 but were shipped after 9th May 2021 from location code 005

 

 

 

 

 

 

 

   select count(distinct CARGO_SEQNO) As  TenderedCount from SAMPLEDATA t where  T.[LOCATION cODE]='005'
  AND  cast(t.Tendered_Date as date) < '2021-05-09' AND CAST(T.[Ship Date] AS DATE) >= '2021-05-09'

 

 

 

 

 

 

 

Other issue is i need to use above meassure and plot this numbers on below chart as Line values, here the shared axis is based on ship date and it shows the count of units tht were shipped on that particular day.

 

sarthaks_0-1621502351603.png

 

I am new to DAX, please advise. 

2 ACCEPTED SOLUTIONS
mahoneypat
Microsoft Employee
Microsoft Employee

Please see this article for how to do this.

Events in progress – DAX Patterns

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

Anonymous
Not applicable

Thanks! for the link , the details provided helped to fix the isssue

View solution in original post

2 REPLIES 2
mahoneypat
Microsoft Employee
Microsoft Employee

Please see this article for how to do this.

Events in progress – DAX Patterns

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Thanks! for the link , the details provided helped to fix the isssue

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.