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

How to create measure to display value from previous label without calculated column

Hi,

 

How can I create a measure which can be populated for each row in [# Issues in Prev Month] based on [# Issues] of the previous label without using a calculated column? The label is actually a month, but is not in the default month format.

 

 # Issues# Issues in Prev Month
2018M1250
2019M0135
2019M0243
2019M0354
1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

Please see the example below

LM Sales =
CALCULATE(
[Sales Amount], -- Mesure 
PREVIOUSMONTH('Date'[Date]) --PREVIOUSMONTH function with Date field from Calendar table
)

Hope this helps
Mariusz

View solution in original post

5 REPLIES 5
Mariusz
Community Champion
Community Champion

Hi @Anonymous 

Please see the example below

LM Sales =
CALCULATE(
[Sales Amount], -- Mesure 
PREVIOUSMONTH('Date'[Date]) --PREVIOUSMONTH function with Date field from Calendar table
)

Hope this helps
Mariusz
Anonymous
Not applicable

Hi @Mariusz ,

 

I have tried the PREVIOUSMONTH function but to not much success... The label does not seem to be recognised as a month.

 

The error says "A column specified in the call to function 'PREVIOUSMONTH' is not of type 'DATE'. This is not supported."

 

 

Hi @Anonymous 

You can use the below patern 

Add Column // 

Rank =
RANKX(
ALL(Table1),
INT(SUBSTITUTE(Table1[Month], "M", "")),,
ASC
)

Add Measure:~
PM Value =
VAR PM = MIN(Table1[Rank]) -1
RETURN
CALCULATE(
SUM(Table1[Value]),
ALL(Table1),
Table1[Rank] = PM
)

 

Anonymous
Not applicable

Hi @Mariusz, Unfortunately this also does not work as my column of values are actually calculated values and not really a column in the data model, so it seems like the sum() function will not accept my "column" of measures. Thanks for your help. I will try to obtain the column of dates to make the PREVIOUSMONTH work instead.

Hi @Anonymous 

 

You can use MAX instead 

Mariusz

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.