cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## Creating Arrows to trend values over a certain period of time

Good Morning. So i have a PBI dashboard I created (very amature) and I need some help.

I need to show wheather the value is up or down from the previous month. I know how to add the arrows with conditional formatting, the issue I'm running into is the calculation. I used a previous dashboard as a guide, but the formula to calculate the difference Month over month is not right. Does anyone have the syntax or guidence for how to write this so it work. Right now i currently have a measure created :

"

%_Count_Mom_Var = IF(CALCULATE(SUM('Carc_Rarc_Historical'[Patnum]),ALL(Dates[Date_Id]),FILTER(ALL(Dates),Dates[Date_Rank]=SELECTEDVALUE(Dates[Date_Rank])-1))=0,"", (CALCULATE(SUM('Carc_Rarc_Historical'[Patnum]))-CALCULATE(SUM('Carc_Rarc_Historical'[Patnum]),ALL(Dates[Date_Id]),FILTER(ALL(Dates),Dates[Date_Rank]=SELECTEDVALUE(Dates[Date_Rank])-1)))/CALCULATE(SUM('Carc_Rarc_Historical'[Patnum]),ALL(Dates[Date_Id]),FILTER(ALL(Dates),Dates[Date_Rank]=SELECTEDVALUE(Dates[Date_Rank])-1)))"

and it is calculating zero for every field, so i know its wrong. I just don't know how to fix it.

1 ACCEPTED SOLUTION
Community Support

Hi, @Anonymous

You can try the following methods.

``````%_Count_Mom_Var =
IF (
CALCULATE ( SUM ( 'Carc_Rarc_Historical'[Patnum] ),
FILTER ( ALL ( Dates ),
Dates[Date_Rank] = SELECTEDVALUE ( Dates[Date_Rank] ) - 1
)
) = 0,
"",
CALCULATE ( SUM ( 'Carc_Rarc_Historical'[Patnum] )
- CALCULATE ( SUM ( 'Carc_Rarc_Historical'[Patnum] ),
FILTER ( ALL ( Dates ),
Dates[Date_Rank] = SELECTEDVALUE ( Dates[Date_Rank] ) - 1
)
)
)
/ CALCULATE ( SUM ( 'Carc_Rarc_Historical'[Patnum] ),
FILTER ( ALL ( Dates ),
Dates[Date_Rank] = SELECTEDVALUE ( Dates[Date_Rank] ) - 1
)
)
)``````

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support

Hi, @Anonymous

You can try the following methods.

``````%_Count_Mom_Var =
IF (
CALCULATE ( SUM ( 'Carc_Rarc_Historical'[Patnum] ),
FILTER ( ALL ( Dates ),
Dates[Date_Rank] = SELECTEDVALUE ( Dates[Date_Rank] ) - 1
)
) = 0,
"",
CALCULATE ( SUM ( 'Carc_Rarc_Historical'[Patnum] )
- CALCULATE ( SUM ( 'Carc_Rarc_Historical'[Patnum] ),
FILTER ( ALL ( Dates ),
Dates[Date_Rank] = SELECTEDVALUE ( Dates[Date_Rank] ) - 1
)
)
)
/ CALCULATE ( SUM ( 'Carc_Rarc_Historical'[Patnum] ),
FILTER ( ALL ( Dates ),
Dates[Date_Rank] = SELECTEDVALUE ( Dates[Date_Rank] ) - 1
)
)
)``````

Is this the result you expect?

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

#### Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors