Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Measure transformation from varying on all dates to lastdate of the month

Dear all,

 

I hope you are well.

 

I have three different tables:

- A calendar table;

- A visitors table with the logins, one row represents one login.

 

I calculate the Weekly Active Users (WAU). The formula I use requires me to compute it for each date, like that:

 

araignee_0-1647946635764.png

 

I would need to have the WAU as measure for the very last date of the period and not depending on/for each date, so, one datapoint for each month.

 

Here is the original formula:

 

WAU =

var currentDate = SELECTEDVALUE('calendar'[Date])
var date7DaysAgo = FIRSTDATE(DATEADD('calendar'[Date], -7, DAY))

RETURN
CALCULATE(
DISTINCTCOUNT('Visitors'[Visitor ID])
,'calendar'[Date] <=currentDate,
'calendar'[Date] > date7DaysAgo)

 

Thank you in advance for your help! I appreciate it.

 

I am at your disposal should you have any questions.

 

A

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , for that you need a measure like

 

MTD Sales = CALCULATE(lastnonblankvalues('Date'[Date],DISTINCTCOUNT('Visitors'[Visitor ID])) ,DATESMTD('Date'[Date]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , for that you need a measure like

 

MTD Sales = CALCULATE(lastnonblankvalues('Date'[Date],DISTINCTCOUNT('Visitors'[Visitor ID])) ,DATESMTD('Date'[Date]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

I would need to keep the base formula the same as it is a metric.

Anonymous
Not applicable

I worked around it, it works! I did not know the function LASTNONBLANKVALUE.

 

Thank you amitchandak! You are an angel!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.