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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Fred_PT
Frequent Visitor

Accumulated vs Daily

Hi,

 

I'm trying to create a table where I have a column with values accumulated by product since the beginning of the month and need the value of only the day in a new column. I do not know if a new column or a measurement which is the right/efficient one. What i want to do is a slicer that user chooses to see the values accumulated or daily.
I think the function to use is EARLIER, but I do not know how.
Can you help me?

Thanks

 

Image_.png

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

Hi @Fred_PT,

 

You can create a calculated column like below:

 

Value daily = var pre= CALCULATE(MAX(Table1[Value accum]), FILTER('Table1','Table1'[Product]=EARLIER(Table1[Product]) && 'Table1'[Date]<EARLIER('Table1'[Date])))
return 'Table1'[Value accum]-pre

 

a2.PNG

 

Or create a measure:

 

Measure = var p=CALCULATE(MAX('Table1'[Value accum]),FILTER(ALL('Table1'),'Table1'[Product]=MAX('Table1'[Product]) && 'Table1'[Date]<MAX('Table1'[Date])))
return MAX(Table1[Value accum])-p

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
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

2 REPLIES 2
v-qiuyu-msft
Community Support
Community Support

Hi @Fred_PT,

 

You can create a calculated column like below:

 

Value daily = var pre= CALCULATE(MAX(Table1[Value accum]), FILTER('Table1','Table1'[Product]=EARLIER(Table1[Product]) && 'Table1'[Date]<EARLIER('Table1'[Date])))
return 'Table1'[Value accum]-pre

 

a2.PNG

 

Or create a measure:

 

Measure = var p=CALCULATE(MAX('Table1'[Value accum]),FILTER(ALL('Table1'),'Table1'[Product]=MAX('Table1'[Product]) && 'Table1'[Date]<MAX('Table1'[Date])))
return MAX(Table1[Value accum])-p

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Qiuyun Yu,

 

Solved wonderfully!! Thank you very much for your quick response.

 

 

Best regards,

Fred

Helpful resources

Announcements
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.