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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors