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
augustindelaf
Impactful Individual
Impactful Individual

Issue with Previous Month measure

Hello,

 

I have a table called Records_Africa. In this table, there is a measure called "Agility Score Conversion", that gets values that can be 1, 2, 3, 4 or nothing. When the user filters a date Slicer, "Agility Score Conversion" value is updated.

I successfully created a measure that gets the previous month of my Agility Score Conversion measure, but no result is displayed in Power BI (Blank value is displayed).

 

Here is the measure I created. Can you explain me why it doesn't display ?

Evol AGILITY SCORE CONV = CALCULATE([AGILITY SCORE Conv]; PREVIOUSMONTH(Records_Africa[Month]))
 
The value is "Blank". Why ?The value is "Blank". Why ?
I also tried to do it with a Date dimension but it did'nt change anything (visual is still Blank) : 
Evol AGILITY SCORE CONV = CALCULATE([AGILITY SCORE Conv]; PREVIOUSMONTH('time'[Date]))
 
Here is the file (Essec_Training_File_test) : 
 
Best regards,
Augustin

 

_

2 ACCEPTED SOLUTIONS

Hello @v-lid-msft ,

 

many thanks for your kind anwser.

I opened your file to see how it works and to reproduce elements.

 

In my file, I created the CALENDARAUTO function as you mentioned.

In my file, I also used your function, (I already tried that one, Btw), like in your file.

 

Still, it doesn't work, because M and M-1 measures are always the same.

 

I reproduced exactly what you saidI reproduced exactly what you said

In my source file, they should be different. (see image)

Value for 05/2016 should be 3, and value for 06/2016 should be 4Value for 05/2016 should be 3, and value for 06/2016 should be 4

 

I uploaded my file in OneDrive, as you proposed.  There is no confidential data.

https://1drv.ms/u/s!AkOv33tEaCSw1UEuNOB4Bvw_Q-AU?e=GJOxA1

 

PS : my measure for current month already has, and must have a LASTDATE function, because it needs to get only last result, not a sum of results from previous months.

Would you mind looking a bit at it, please?

 

Thanks in advance,

BR,

Augustin

View solution in original post

For your information, I found my own solution. 

 

LM AGILITY SCORE CONV = CALCULATE(SUM(Records_Africa[Agility Score Conversion]); PREVIOUSMONTH(('Month'[Month])))
 
My Month Table was not correctly linked to facts Table.
BR,
 
Augustin

View solution in original post

3 REPLIES 3
v-lid-msft
Community Support
Community Support

Hi @augustindelaf ,

 

We suggest you to create a calendar table called DATE using CALENDARAUTO() function, then We can try to using the following DAX to get the value of previous month.

 

Evol AGILITY SCORE CONV =
CALCULATE (
    [AGILITY SCORE Conv],
    DATEADD ( 'DATE'[Date], -1, MONTH )
)

Issue-with-Previous-Month-measure-1.png

 

But because we do not have permission to download the test pbix file you shared, so if it does not meet your requirement, please kindly share your sample data and excepted result to me if you don't have any Confidential Information. Please upload your files to One Drive and share the link here.

 

BTW, pbix as attached.

 

Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-lid-msft ,

 

many thanks for your kind anwser.

I opened your file to see how it works and to reproduce elements.

 

In my file, I created the CALENDARAUTO function as you mentioned.

In my file, I also used your function, (I already tried that one, Btw), like in your file.

 

Still, it doesn't work, because M and M-1 measures are always the same.

 

I reproduced exactly what you saidI reproduced exactly what you said

In my source file, they should be different. (see image)

Value for 05/2016 should be 3, and value for 06/2016 should be 4Value for 05/2016 should be 3, and value for 06/2016 should be 4

 

I uploaded my file in OneDrive, as you proposed.  There is no confidential data.

https://1drv.ms/u/s!AkOv33tEaCSw1UEuNOB4Bvw_Q-AU?e=GJOxA1

 

PS : my measure for current month already has, and must have a LASTDATE function, because it needs to get only last result, not a sum of results from previous months.

Would you mind looking a bit at it, please?

 

Thanks in advance,

BR,

Augustin

For your information, I found my own solution. 

 

LM AGILITY SCORE CONV = CALCULATE(SUM(Records_Africa[Agility Score Conversion]); PREVIOUSMONTH(('Month'[Month])))
 
My Month Table was not correctly linked to facts Table.
BR,
 
Augustin

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.