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

Blank() value for dates from end of current month

Hi all

 

I am struggling with a measure... hope you can help! 

 

I have a database with contracts, and one with sales orders (by shipdate). 

I created a measure which flags whether sales orders are higher, lower, or OK compared to the contract that month. The measure gives Blank() values for either no contract/no sales order combination. But I would also like it to give Blank() for any date beyond the end of the current month.

This last part is where I cannot manage to get it to work. The underlined part in the measure throws an error: a single value for column timestamp_dt in table date dimension cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation.

 

any ideas? 

 

 

Contract Application =
IF(
      AND(ISBLANK([Quantity Shipped by Actual Ship Date]),ISBLANK([ContractQty by Del/Ship From])),
          BLANK(),
         IF( (([ContractQty by Del/Ship From] - [Quantity Shipped by Actual Ship Date])/[ContractQty by Del/Ship From])>0.05,
      IF((Year('date_dimension'[timestamp_dt])*100+Month('date_dimension'[timestamp_dt]))>(YEAR(Today())*100+ MONTH(Today())),Blank(),"Lower"),
          IF( (([ContractQty by Del/Ship From] - [Quantity Shipped by Actual Ship Date])/[ContractQty by Del/Ship From])<-0.05, "Higher","OK"))
)
'date_dimension'[timestamp_dt] --> main date column (eg 09-07-17 ) 
 
Expected result:
Quantity Shipped by Actual Ship DateContractQty by Del/Ship Fromyearmonthnumber (Aggragated)Contract Application MTD
23940,9721043.14201810Higher
24804,0223642.94201811OK
17454,8620688.44201812Lower
24007,7023047.65201901OK
20452,6823990.67201902Lower
20789,2524487.06201903Lower
2852,0722460.74201904Lower
 18994.67201905 
 20451.6201906 
 19995.34201907 
 19335.41201908 
 
Any help would be greatly appreciated...!!
2 REPLIES 2
aemb
Frequent Visitor

Would still love the community's input on this one! let me know in case the ask is unclear! Thanks a lot in advance:)

parry2k
Super User
Super User

@aemb please read this post to get your answer quickly https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

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.