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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Employee
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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.