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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

How can i divide the value of today with the value of yesterday

Hello fellow PowerBI Users,

 

i want to divide the value from the Today with the value from yesterday per RES_NR and put it in a new Column so i can easily print the % next to the days in the same Visuals.

I get the Date from the Column HIS_DATE and the Values from the Column ENGPASS.

 

I tried it for an hour now and im hoping someone is able to help me.

 

Steallight_0-1717683197160.png

 

Greetings,

Steallight

 

 

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @Anonymous - Calculate the percentage change between the values from today and yesterday per RES_NR and put it in a new column.

 

Percentage_Change =
VAR Today_Value = [ENGPASS]
VAR Yesterday_Value =
CALCULATE(
FIRSTNONBLANK([ENGPASS], 1),
FILTER(
ALL('YourTable'),
'YourTable'[HIS_DATE] = TODAY() - 1 && 'YourTable'[RES_NR] = EARLIER('YourTable'[RES_NR])
)
)
RETURN
IF(
ISBLANK(Yesterday_Value),
BLANK(),
DIVIDE(Today_Value - Yesterday_Value, Yesterday_Value)
)

 

Above calculated column today's and yesterday's values for each RES_NR and returns the result in a new column called Percentage_Change If there is no value for yesterday, it returns blank.

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





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

Proud to be a Super User!





View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create calculated column.

New =
var _today=TODAY()
var _todayvalue=
SUMX(FILTER(ALL('Table'),'Table'[HIS_DATE]=_today&&'Table'[RES_NR]=EARLIER('Table'[RES_NR])),[ENGPASS])
var _yesterday=
SUMX(FILTER(ALL('Table'),'Table'[HIS_DATE]=_today-1&&'Table'[RES_NR]=EARLIER('Table'[RES_NR])),[ENGPASS])
return
DIVIDE(
    _yesterday,_todayvalue)

2. Select [New] -- %.

vyangliumsft_0-1717742564732.png

3. Result:

vyangliumsft_1-1717742564734.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

rajendraongole1
Super User
Super User

Hi @Anonymous - Calculate the percentage change between the values from today and yesterday per RES_NR and put it in a new column.

 

Percentage_Change =
VAR Today_Value = [ENGPASS]
VAR Yesterday_Value =
CALCULATE(
FIRSTNONBLANK([ENGPASS], 1),
FILTER(
ALL('YourTable'),
'YourTable'[HIS_DATE] = TODAY() - 1 && 'YourTable'[RES_NR] = EARLIER('YourTable'[RES_NR])
)
)
RETURN
IF(
ISBLANK(Yesterday_Value),
BLANK(),
DIVIDE(Today_Value - Yesterday_Value, Yesterday_Value)
)

 

Above calculated column today's and yesterday's values for each RES_NR and returns the result in a new column called Percentage_Change If there is no value for yesterday, it returns blank.

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





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

Proud to be a Super User!





Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.