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

Calendar Function not working with new version of power BI

The following measure is not working in powerbi desktop.

3 Months Unit Sold = CALCULATE([Units Sold],DATESINPERIOD(DimDate[FullDateAlternateKey],LASTDATE(DimDate[FullDateAlternateKey]),-3,MONTH))

 

When the same measure is created in Excel 2016 powerpivot it works.

 

Is this a bug?

 

2 ACCEPTED SOLUTIONS

Hi,

 

Here are the changes i made

 

  1. I edited your date relationship of dates.  I hehashed it to "DueDate column of the FactInternetSalesTable to FullDateAlternateKey column of the DimDate Table.  See image below
  2. I edited your 3 Months Units sold calculated field formula to

 

=CALCULATE([Units Sold],DATESINPERIOD(DimDate[FullDateAlternateKey],LASTDATE(DimDate[FullDateAlternateKey]),-3,MONTH))

 

The correct result is shown below

 

Untitled.pngUntitled1.png

 


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

View solution in original post

Hi,

 

The third last column in your FaceInternetSales table is a proper date.  The relationship should be from that column to the FullDateAlternateKey column of the DimDate column table.


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

View solution in original post

13 REPLIES 13

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.