Forum Discussion
Day to Day average
- 6 months ago
Please try the following logic:
Day to Day % = VAR PrevValue = CALCULATE ( SUM ( 'Table'[Life Total] ), DATEADD ( 'Table'[Date Run], -1, DAY ) ) VAR CurrValue = SUM ( 'Table'[Life Total] ) RETURN IF ( NOT ISBLANK ( PrevValue ), DIVIDE ( CurrValue - PrevValue, PrevValue ) )
OK, assuming you have a model involving a Date table called Date and a column Date in it (Date[Date]), connected to your fact table, you can define this measure
Delta =
VAR _LifeTotalCurrentDate = [Life Total]
VAR _LifeTotalPreviousDate = CALCULATE ( [Life Total], DATEADD ( Date[Date], -1, DAY ) )
RETURN
DIVIDE ( _LifeTotalCurrentDate - _LifeTotalPreviousDate, _LifeTotalPreviousDate )
If you are not using a date table, please let me know, in that case I need to see the model tables and the relationships, to link them to how you arranged the visual
If this helped, please consider giving kudos and mark as a solution
me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI
this is single table, I just want to get day to day percentage for this chart
for example: on Life Total column, (11,214,592-10,193,377)/10,193,377 to get a percentage of 10.01% for Day Count 1
- Ashish_Mathur6 months agoSuper User
Hi,
Share the download link of the PBI file.
- FBergamaschi6 months agoSuper User
Hi fbostan1
in order to help you, since you are not using a separated calendar table, I need details. I need the list of all the columns involved in the visual and so on. Since this might take a long time, please can you send me the pbix file via mail - if yes send me a private message and I shall share my mail - or share it here through a link to a cloud service? In this way we speed up.
Just an additional note: it is a bad practice to use a single table, so once we fix this, please consider using a data model with facts and dimensions separated, shall provide you some guidance on that. Just to help you use Power BI in the best possible way to get the best out of it
If this helped, please consider giving kudos and mark as a solution
@me in replies or I'll lose your thread
Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page
Consider voting this Power BI idea
Francesco Bergamaschi
MBA, M.Eng, M.Econ, Professor of BI