cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Helper III

## Need help to get 1st day value in each row

Hi Expert

I need month 1st date value each day, for good understanding please see the example below:

Date                Amount      1st Date Amount (required this)

01 Jan 2020    80,225           80,225

02 Jan 2020    80,400           80,225

03 Jan 2020    80,500           80,225

04 Jan 2020    80,800           80,225

04 Jan 2020    80,900           80,225

I got this resolution which worked well when I use a simple date format like above but it's not working when I turn the date into Hierarchy. The resolution I got is below

1 Day Value =

VAR currentyear =
YEAR ( MAX ( Billing[Date2]) )
VAR currentmonth =
MONTH ( MAX ( Billing[Date2]) )
VAR currentmonthfirstday =
DATE ( currentyear, currentmonth, 1 )
RETURN
CALCULATE ( Billing[Billing], Billing[Date2] = currentmonthfirstday )

1 ACCEPTED SOLUTION
Helper III

Hi Kim

3 REPLIES 3
Super User

If you convert the context to the date-hierarchy, I think you need to add one more condition into the measure, because the context is changed.

1 Day Value =

VAR currentyear =
YEAR ( MAX ( Billing[Date2]) )
VAR currentmonth =
MONTH ( MAX ( Billing[Date2]) )
VAR currentmonthfirstday =
DATE ( currentyear, currentmonth, 1 )
RETURN
CALCULATE ( Billing[Billing], Filter(ALL(Billing), Billing[Date2] = currentmonthfirstday ))

Hi, My name is Jihwan Kim.

If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

Visit my LinkedIn page by clicking here.

Schedule a meeting with me to discuss further by clicking here.

Helper III

Hi Kim

Super User

Hi,

What do you mean by "when I turn the date into Hierarchy"?  Show the result you are expecting.

Regards,
Ashish Mathur
http://www.ashishmathur.com

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

#### Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors