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
mimi320
Frequent Visitor

Sum if between two dates and keep blanks

I hope this is simple and clear.

 

I have the following;

  • Invoice Start Date
  • Invoice End Date
  • Qty Sold

I need to calculate the sum of Qty Sold between Invoice Start Date and Invoice End Date, AND if the value is blank to show blank.

4 REPLIES 4
Sushain
Frequent Visitor

Hello @mimi320 ,

Plz find the DAX expression for your problem. Let me know if this doesn't solve your issue.

Total = IFERROR(CALCULATE(SUM('Table_name'[Qty Sold]),DATESBETWEEN('Table_name','Table_name'[Invoice Start Date],'Table_name'[Invoice End Date])),BLANK())
NickolajJessen
Solution Sage
Solution Sage

Hi, can be more specifik in what you are trying to do?

Please refer to this link:
https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523#M6071...

Allright, after having a look at your report, i'd suggest you instead spend some time looking up how to make a datamodel. Specifically you shoud learn about:
1. The difference between fact tables and dimension tables
2. How to create relationships between them.
Avi Singh is my goto resource for this.

I know it doesn't answer your immediate question, but this task would be so much easier, if there was a proper datamodel behind it. If you rid yourself of these many-to-many bidirectional relationships, your report will behave more predictably.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.