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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Mister_PowerBI
Frequent Visitor

Spread projectvalue across now and project_end_date

Hello everybody, 

 

I have a hard time getting this figured out and was hoping maybe somebody can help me out .

 

Let's say I have a database with projects that have an end_date and a remaining_project_value column. I would like to spread the remeaning_project_value over the dates between UTCNOW() and end_date and show this in an interactive visual that can be switched. So the visual needs to be able to switch from week to month, and show the remaining_project_value accordingly. 

 

Can anybody put me in the right direction?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Mister_PowerBI ,

I created some data:

vyangliumsft_0-1671673801760.png

Here are the steps you can follow:

1. Create calculated column.

Week = WEEKNUM('Table'[end_date ],2)

2. Enter data – create  a table.

vyangliumsft_1-1671673801762.png

3. Create measure.

Flag =
var _select=SELECTEDVALUE('Slicer_Table'[Slicer])
var _today=TODAY()
var _minweekdate=
MINX(FILTER(ALL('Table'),YEAR('Table'[end_date ])=YEAR(MAX('Table'[end_date ]))&&'Table'[Week]=
MINX(FILTER(ALL('Table'),'Table'[end_date ]=_today),[Week])),[end_date ])
return
SWITCH(
    TRUE(),
    MAX('Slicer_Table'[Slicer])="Month"&&MAX('Table'[end_date ])>=DATE(YEAR(_today),MONTH(_today),1)&&MAX('Table'[end_date ])<=_today,1,
    MAX('Slicer_Table'[Slicer])="Week"&&MAX('Table'[end_date ])>=_minweekdate&&MAX('Table'[end_date ])<=_today,1,
    0)

4. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_2-1671673801763.png

5. Result:

vyangliumsft_3-1671673801764.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi  @Mister_PowerBI ,

I created some data:

vyangliumsft_0-1671673801760.png

Here are the steps you can follow:

1. Create calculated column.

Week = WEEKNUM('Table'[end_date ],2)

2. Enter data – create  a table.

vyangliumsft_1-1671673801762.png

3. Create measure.

Flag =
var _select=SELECTEDVALUE('Slicer_Table'[Slicer])
var _today=TODAY()
var _minweekdate=
MINX(FILTER(ALL('Table'),YEAR('Table'[end_date ])=YEAR(MAX('Table'[end_date ]))&&'Table'[Week]=
MINX(FILTER(ALL('Table'),'Table'[end_date ]=_today),[Week])),[end_date ])
return
SWITCH(
    TRUE(),
    MAX('Slicer_Table'[Slicer])="Month"&&MAX('Table'[end_date ])>=DATE(YEAR(_today),MONTH(_today),1)&&MAX('Table'[end_date ])<=_today,1,
    MAX('Slicer_Table'[Slicer])="Week"&&MAX('Table'[end_date ])>=_minweekdate&&MAX('Table'[end_date ])<=_today,1,
    0)

4. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_2-1671673801763.png

5. Result:

vyangliumsft_3-1671673801764.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.