Forum Discussion
Calculate variance from previous date
- Anonymous2 years ago
Hi, gr84
Based on your description, If you have a date column, you can create following new columns to achieve the effect you are looking for. Following picture shows the effect of the display.
New columns:
Previous Count = CALCULATE ( MAX ( 'Table'[Value] ), FILTER ( 'Table', 'Table'[Date] = EARLIER ( 'Table'[Date] ) - 1 ) )Variance = IF ( 'Table'[Date] = MIN ( 'Table'[Date] ), BLANK (), 'Table'[Value] - 'Table'[Previous Count] )If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi, gr84
Based on your description, If you have a date column, you can create following new columns to achieve the effect you are looking for. Following picture shows the effect of the display.
New columns:
Previous Count =
CALCULATE (
MAX ( 'Table'[Value] ),
FILTER ( 'Table', 'Table'[Date] = EARLIER ( 'Table'[Date] ) - 1 )
)
Variance =
IF (
'Table'[Date] = MIN ( 'Table'[Date] ),
BLANK (),
'Table'[Value] - 'Table'[Previous Count]
)
If this does not work, could you please share some sample data without sensitive information and expected output.
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum