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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
HusseinKhalil
Helper I
Helper I

Previousmonth calculation showing blank

Hi,

 

i am using the below for previousmonth calculation, but result is always blank.

Syntax: 

PreviousMonth = CALCULATE(SUM('Monthly Speed - All Operators b'[Download Speed Mbps]),PREVIOUSMONTH('Monthly Speed - All Operators b'[Aggregate Date]))
 
sample for the dataset in the below link
 
 
PME.png
1 ACCEPTED SOLUTION

@HusseinKhalil 

 

PreviousMonth =
CALCULATE (
    SUM ( 'Monthly Speed - All Operators b'[Download Speed Mbps] ),
    PREVIOUSMONTH ( 'Monthly Speed - All Operators b'[Aggregate Date].[Date] )
)

 

03.JPG

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

View solution in original post

5 REPLIES 5
nandukrishnavs
Community Champion
Community Champion

@HusseinKhalil 

 

This is because of the date hierarchy. 

 

o1.JPG

o2.JPG

 

PreviousMonth =
CALCULATE (
    SUM ( 'Monthly Speed - All Operators b'[Download Speed Mbps] ),
    PREVIOUSMONTH ( 'Monthly Speed - All Operators b'[Aggregate Date].[Date] )
)

 

03.JPG



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂

 


Regards,
Nandu Krishna

thanks you nandu, but it worked now, but i noticed that aggregate date format inside matrix changed.= and not showing year/month any more. 

 

is there a way to handle this and keep the format as it is?

@HusseinKhalil , best way is use date table for this

PreviousMonth = CALCULATE(SUM('Monthly Speed - All Operators b'[Download Speed Mbps]),PREVIOUSMONTH('Date'[Date]))

 

To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@HusseinKhalil  - Yes I have modified the above reply. Please check that.


Regards,
Nandu Krishna

@HusseinKhalil 

 

PreviousMonth =
CALCULATE (
    SUM ( 'Monthly Speed - All Operators b'[Download Speed Mbps] ),
    PREVIOUSMONTH ( 'Monthly Speed - All Operators b'[Aggregate Date].[Date] )
)

 

03.JPG

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂


Regards,
Nandu Krishna

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.