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
Hyperchef1969
Helper V
Helper V

Previous month calculation does not show previous month of first date in dataset

Hi,

 

I have a problem with previous month calculation. For the first date in the dataset, there is no previous month date visible. Therfore also no reporting period. For the next date in the dataset there is (2/1/2017). Therefore the graph does not show the right period for the first month, in this case it should be 2017-01. Does anyone have a solution? I am new into Power BI, so maybe the solution is very simple, but I don't see it right know

 

Thanks in advance!

 

Power BI - Citrix Receiver_2018-03-16_11-31-03.pngPower BI - Citrix Receiver_2018-03-16_11-35-39.png

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @Hyperchef1969,

 

According to your description and snapshot, I found period column not contains correspond date label '2017-01'.

 

Since 'period column' formula is based on 'previous month' column, I'd like to suggest you to modify 'previous month' column formula to shows correct result.(period column will follow that column to show formatted date label.)

 

 

BTW, I think you are use dateadd function to calculate previous month date, right?

 

If this is a case, current dateadd only calculate on existed date range, if it out of current date range, it will return blank.

You can use date function to calculate.

 

Sample:

previous month =
DATE ( YEAR ( [Report_Date] ), MONTH ( [Report_Date] ) - 1, DAY ( [Report_Date] ) )

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @Hyperchef1969,

 

According to your description and snapshot, I found period column not contains correspond date label '2017-01'.

 

Since 'period column' formula is based on 'previous month' column, I'd like to suggest you to modify 'previous month' column formula to shows correct result.(period column will follow that column to show formatted date label.)

 

 

BTW, I think you are use dateadd function to calculate previous month date, right?

 

If this is a case, current dateadd only calculate on existed date range, if it out of current date range, it will return blank.

You can use date function to calculate.

 

Sample:

previous month =
DATE ( YEAR ( [Report_Date] ), MONTH ( [Report_Date] ) - 1, DAY ( [Report_Date] ) )

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.