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

Preparing for a certification exam? Ask exam experts all your questions on May 15th. Register now.

Reply
mdmasumssg
Regular Visitor

Previous month dax returning balnk

My pas rate Dax
Pass Rate =
Var pas = SUM(QA_Main_AllFG[Check_QTY])
Var Def = SUM(QA_Main_AllFG[Defect_QTY])
RETURN
DIVIDE(pas,(pas+Def),0)

 

MY previous month dax
Pre_Month = CALCULATE(
[Pass Rate],
PREVIOUSMONTH('QA_Main_AllFG'[Date]))

previous month is  showing blank 

Please help me to solve the issues

mdmasumssg_0-1745392047699.png

 

7 REPLIES 7
v-tsaipranay
Community Support
Community Support

Hi @mdmasumssg ,

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

v-tsaipranay
Community Support
Community Support

Hi @mdmasumssg   ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

v-tsaipranay
Community Support
Community Support

Hi @mdmasumssg ,

Thank you for reaching out to the Microsoft Fabric Community. Also thank you @Cookistador  for your input.

 

Regarding your issue with the PREVIOUSMONTH function returning blank values in your DAX measure, this behavior is typically caused by the way time intelligence functions interact with date contexts in your model.

 

Please following these steps, the PREVIOUSMONTH function will correctly identify the prior month based on your calendar table, and your Pre_Month measure will return expected, non-blank values.

  • Ensure you have a dedicated calendar (date) table in your model that covers the entire date range you need. This table must have a continuous range of dates without gaps.
  • In Power BI or Fabric, mark your calendar table as a Date table. This step is essential for the time intelligence functions like PREVIOUSMONTH to work properly.
    You can do this by selecting the calendar table, then going to the Modeling tab and choosing “Mark as Date Table” and selecting the date column.
  • Modify your Pre_Month measure to reference the date column from your calendar table, not the date column in your fact table. For example:
Pre_Month =  
CALCULATE(  
    [Pass Rate],  
    PREVIOUSMONTH('Calendar'[Date])  
)  
  • There must be a one-to-many (1:* ) relationship between 'Calendar'[Date] and 'QA_Main_AllFG'[Date], with the filter direction from calendar table to fact table. Also make sure all date filters, slicers, and visuals are using the calendar table’s date columns to maintain a consistent and reliable filter context.

If you continue to face issues, please provide sample data of your model relationships so we can assist further.

 

I hope this will resolve your issue, if you need any further assistance, feel free to reach out.

If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

 

Thankyou.

 

Hi @mdmasumssg   ,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.


Thank you.

mdmasumssg
Regular Visitor

QA_Main_AllFG'[Date]  it is data entry date column. I have a cematic date table in my power BI service.I have connect it and try it but result showing blank also 

Can you share some samples of your tables to let me make some tests on my side ?

Cookistador
Solution Sage
Solution Sage

Do you have a calendar table in your model?

 

With the clues you shared with us, I think the issue is comming from
the fact that Time intelligence functions need a continuous range of dates to correctly identify periods like the "previous month."

If your 'QA_Main_AllFG'[Date] column is just a column within your fact table and not related to a dedicated date table, or if your date table is not correctly set up or marked as a date table, Power BI cannot reliably determine what the "previous month" is in the context of your visual.

 

Helpful resources

Announcements
PBIApril_Carousel

Power BI Monthly Update - April 2025

Check out the April 2025 Power BI update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors