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
Dukezera
Frequent Visitor

Linear descending line according to a measure

Hello guys,

I have a calendar table where I created with M.
I'm relating it to a table of activities, where I grouped it by week.
I've calculated the total value of activities I have in that time period by a DAX measure (let's consider 5000), I need to plot a linear descending line over the period from that value (5000) to 0.
I've managed to get close results, but it doesn't stay at 0. It either exceeds or is missing 1 period of time.

Here is the current table and the expected table:

YearMonthEnd of WeekExpected
2021605/jun/21 
2021612/jun/21 
2021619/jun/21 
2021626/jun/21 
2021703/jul/21 
2021710/jul/21 
2021717/jul/21 
2021724/jul/21 
2021731/jul/21 
2021807/ago/21 
2021814/ago/21 
2021821/ago/21 
2021828/ago/21 
2021904/set/21 
2021911/set/21 
2021918/set/21 
2021925/set/21 
20211002/out/21 
20211009/out/21 
20211016/out/21 
20211023/out/21 
20211030/out/21 
20211106/nov/21 
20211113/nov/21 
20211120/nov/21 
20211127/nov/21 
20211204/dez/21 
20211211/dez/21 
20211218/dez/21 
20211225/dez/21 
2022101/jan/22 
2022108/jan/22 
2022115/jan/22 
2022122/jan/22 
2022129/jan/22 
2022205/fev/22 

 

Table I need:

YearMonthEnd of WeekExpected
2021605/jun/215000
2021612/jun/214857,143
2021619/jun/214714,286
2021626/jun/214571,429
2021703/jul/214428,571
2021710/jul/214285,714
2021717/jul/214142,857
2021724/jul/214000
2021731/jul/213857,143
2021807/ago/213714,286
2021814/ago/213571,429
2021821/ago/213428,571
2021828/ago/213285,714
2021904/set/213142,857
2021911/set/213000
2021918/set/212857,143
2021925/set/212714,286
20211002/out/212571,429
20211009/out/212428,571
20211016/out/212285,714
20211023/out/212142,857
20211030/out/212000
20211106/nov/211857,143
20211113/nov/211714,286
20211120/nov/211571,429
20211127/nov/211428,571
20211204/dez/211285,714
20211211/dez/211142,857
20211218/dez/211000
20211225/dez/21857,1429
2022101/jan/22714,2857
2022108/jan/22571,4286
2022115/jan/22428,5714
2022122/jan/22285,7143
2022129/jan/22142,8571
2022205/fev/220

 

It is recommended that I remove the decimal places from the visualization of the graph of the linear line. However, I will not round the value for the line to be straight down.

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Dukezera ,

Test the below:

step1,create index :

vluwangmsft_0-1654072928472.png

Step 2,use the below dax to create a new column:

expect = round(5000-('Table'[Index]-1)*5000/35,3)

Output result:

vluwangmsft_1-1654073002049.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

3 REPLIES 3
v-luwang-msft
Community Support
Community Support

Hi @Dukezera ,

Test the below:

step1,create index :

vluwangmsft_0-1654072928472.png

Step 2,use the below dax to create a new column:

expect = round(5000-('Table'[Index]-1)*5000/35,3)

Output result:

vluwangmsft_1-1654073002049.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

amitchandak
Super User
Super User

@Dukezera , assume you have value column for which you want this

 

Cumm Sales = CALCULATE(SUM(Table[Value]),filter(allselected(date),date[date] >=max(date[Date])))

@amitchandak I don't have a value column. I have the total amount (5000) calculated in DAX FORMULA. I want to do the EXPECTED Column with this value.

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.