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

end of month in selected dates

Hi!

my table is like this

DateCustomers
29/1/201650
28/2/201670

 

I would like when i select the two dates to have 70 customers

if i select only february 70 customers again

if i select january 50 customers

(end of month in every selection)

1 ACCEPTED SOLUTION
Baskar
Resident Rockstar
Resident Rockstar

Cool dude,

 

Measure = CALCULATE(               SUM(Customers)     ,    ENDOFMONTH(Date) )

 

try this, 

 

Let me know if it is not helping u

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

this works for me:

 

lastdaycurrentmonth = DATE(YEAR(TODAY()),MONTH(TODAY())+1,1)-1

Baskar
Resident Rockstar
Resident Rockstar

Cool dude,

 

Measure = CALCULATE(               SUM(Customers)     ,    ENDOFMONTH(Date) )

 

try this, 

 

Let me know if it is not helping u

thanks!!

so calculate works like sumif in excel?

it sums the customers with an expression?

Yes u r correct .

Thanks @Baskar!

new question relevant to my post @Baskar

i created a table with three values MTD QTD YTD

i put these values to a slicer

and i have this measure  (previoustime)

 

IF(VALUES(YTDQTDMTD[Column1])="MTD";PREVIOUSMONTH('database'[date]);IF(VALUES(YTDQTDMTD[Column1])="QTD";PREVIOUSMONTH(STARTOFQUARTER('database'[date]));IF(VALUES(YTDQTDMTD[Column1])="YTD";PREVIOUSMONTH(STARTOFYEAR('database'[date]));"")))

but when i creater another measure

 

CALCULATE(SUM('database[customers]);previoustime)

it does not work... it says measure previous time is a true false statement

Yes u can't do like this dude.

 

because the calculate function is different.

 

CALCULATE(SUM('database[customers]);previoustime)

Calculate ( Aggerication , Table ),

 

If u want to use Previoustime in calcylation it should return Table.

 

let me explain y u doing like this and hat u want exactly ? i will help u  

i think i got it! i need a date-table am i right? thanks @Baskar

No Need date table dude , u go with same date column which u have in your table .

 

That will work 

yes got it!

ENDOFMONTH(PREVIOUSMONTH('database'[date]))

 my problem to make previous month work is that the end of every month in my original database is not 31/01/2016 it is 29/01/2016 (the last data date of every month) 

how to have end of month for previous month 29/01/2016 and not 31/01/2016?

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.