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
Jeevan1991
Helper III
Helper III

FTD & MTD Sales Tota

Hi, I have a sales table like the below.

ZoneDateMonthSales
East23-Sep-2020                9.00100
West16-Sep-2020                9.00189
South17-Sep-2020                9.00299
North16-Sep-2020                9.00189
East11-Sep-2020                9.00107
West27-Aug-2020                8.00186
South12-Sep-2020                9.00265
North19-Sep-2020                9.00219
East02-Sep-2020                9.00134
West02-Sep-2020                9.00235
South31-Aug-2020                8.00232
North17-Sep-2020                9.00173
East03-Sep-2020                9.00107
West23-Sep-2020                9.00198
South20-Aug-2020                8.00105
North25-Aug-2020                8.00272
East15-Sep-2020                9.00181
West02-Sep-2020                9.00258
South23-Sep-2020                9.00281
North23-Sep-2020                9.00238

 

Now I wanto create FTD & MTD summary like the below.

FTD = 23rd Sep 2020 (The latest date)

MTD = Entire Sep (9) month

ZoneFTD SalesMTD
East100629
West198880
South281845
North238819
Total817

3173

 

Please help me on this to create a measure in power Bi.

2 ACCEPTED SOLUTIONS
v-easonf-msft
Community Support
Community Support

Hello, @Jeevan1991

Try the following measure:

FTD = DATE(2020,9,23) 
// IF your latest day is today,try formula as below:
// FTD =today()
Measure FTD_SALE = CALCULATE(SUM('Table'[Sales]),FILTER('Table','Table'[Date]='Table'[FTD] ))
MTD_SALE = CALCULATE(SUM('Table'[Sales]),DATESMTD('Table'[Date]))

The result will be displayed as shown below:
82.png

For more details, check the attachment.

Best regards
Community Support Team _ Eason
If this post helps,then consider Accepting it as the solution to help other members find it faster.

View solution in original post

Hi , @Jeevan1991 

If you want to use function "lastdate",you need to consider the current context in measure FTD_SALE:

You can try the formula as below:

 

Measure FTD_SALE =
VAR ftd =
    LASTDATE ( 'Table'[Date] )
RETURN
    CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( 'Table', 'Table'[Date] = ftd ) )

 

 

You also can change the formula FTD as below:

 

FTD = CALCULATE(MAX('Table'[Date]),ALL('Table'[Date]))

 

 

Best Regards,
Community Support Team _ Eason

 

 

View solution in original post

6 REPLIES 6
v-easonf-msft
Community Support
Community Support

Hello, @Jeevan1991

Try the following measure:

FTD = DATE(2020,9,23) 
// IF your latest day is today,try formula as below:
// FTD =today()
Measure FTD_SALE = CALCULATE(SUM('Table'[Sales]),FILTER('Table','Table'[Date]='Table'[FTD] ))
MTD_SALE = CALCULATE(SUM('Table'[Sales]),DATESMTD('Table'[Date]))

The result will be displayed as shown below:
82.png

For more details, check the attachment.

Best regards
Community Support Team _ Eason
If this post helps,then consider Accepting it as the solution to help other members find it faster.

If i use LASTDATE function to identify FTD date then it gives me the same total as the MTD sales only.

FTD Date = LASTDATE(<Date Column>)

Hi , @Jeevan1991 

If you want to use function "lastdate",you need to consider the current context in measure FTD_SALE:

You can try the formula as below:

 

Measure FTD_SALE =
VAR ftd =
    LASTDATE ( 'Table'[Date] )
RETURN
    CALCULATE ( SUM ( 'Table'[Sales] ), FILTER ( 'Table', 'Table'[Date] = ftd ) )

 

 

You also can change the formula FTD as below:

 

FTD = CALCULATE(MAX('Table'[Date]),ALL('Table'[Date]))

 

 

Best Regards,
Community Support Team _ Eason

 

 

Hi @v-easonf-msft 

Thank you so much its working fine. 

Jeevan1991
Helper III
Helper III

Dear Friends @Anonymous 

 

Please help me on the above.

Dear @amitchandak 

 

can you please help me on the above problem?

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.