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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Tairo
Helper I
Helper I

cannot visualize previous month values in graph

I created a measure to calculate values of the previous month. But when I want to use a clustered bargraph to compare actual values and those of the previous month, the values of the previous maonth don't show.

 

Properly I refer in my measure to the date column. Is there a way to visualize actual and previous values in a bar graph?

 

I added a link to an example:

 

Example

 

Tairo

2 ACCEPTED SOLUTIONS

@MFelix,

 

Thanks, that was the solution I was looking for.

 

Unfortenately the conditional formating of power bi don't allow if statemens so I used formula below to change the words.

 

Label = if ('TableName'[Perc. Diff] >= 0.2 || 'TableName'[Perc. Diff] <= -0.20, "divergend", "standard" )

View solution in original post

In conditional format you need to select the use formula in the setup it will allow you to make several ifs.

Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

7 REPLIES 7
MFelix
Super User
Super User

Hi @Tairo,

 

When looking at you model everything is working properly.

 

The question is that when you refer to prior month are you refering to prior month itself or aopriormonth with data meaning:

In april do you want to see March values (that you don't have data) or February data?

 

Regards,

MFelix


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi @MFelix,

 

Thanks a lot for your response.

 

The formulas are working fine,

 

I am collecting a large number of customer remarks for different categories. I am trying to build a dashboard that gives a warning when there is a large increase of customer remarks compared to a previous period. As an indication that there might be something wrong with categoires that exceed a certain value.

 

So to answer your question I like to the month itself, meaning: When there are no values in March I still want to compare April to March. But when I place PrevMonthValue in a graph, the values are not visible.

 

Regards,

 

Tairo

Hi,

I have made a chart using the date (month) and values column and pv month measure and it worked well. For example in February it shows 85 in pv month so matching january.

How are you placing the columns / measures on your chart?

Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi @MFelix,

 

Did you made chart in the example file?

 

When possible I like to create a clustered bar graph with on the x-axis the categories and on the y-axis the #. As values I want to use actual month and previous month.

 

Next I am placing date, catgory, actual and previous value, difference in a table. I want to use conditional formating to make the background color red when the differece exceeds a certain value.

Hi @Tairo,

 

The measures are based on context so when you make a chart with categories on axis and values vs preivous month you need to have the month as a context. Do the following to achieve the necessary setup:

 

  • Place Month / Category on Axis
  • Place Values / PM in Values
  • Drilldown to lowest category and you will have the chart as below:

 

then just make the table as you need: with the following measure added:

Difference = SUM(TableName[Values]) - [PreviousMonthValues]

categorydrill.png

 

Regards,

MFelix

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



@MFelix,

 

Thanks, that was the solution I was looking for.

 

Unfortenately the conditional formating of power bi don't allow if statemens so I used formula below to change the words.

 

Label = if ('TableName'[Perc. Diff] >= 0.2 || 'TableName'[Perc. Diff] <= -0.20, "divergend", "standard" )

In conditional format you need to select the use formula in the setup it will allow you to make several ifs.

Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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