cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yfquirogah
Helper I
Helper I

Measure shows different value when used on a chart

Hi everybody,

I'm having a little issue with one of my charts and I haven't been able to solve it. I have different databases together, one for each month and I created a measure which calculates how many lines I have in the last month according to the date of the last database.

This is the measure I created, it uses a previous measure that just counts the values.

 

 

Current Vacants = 
VAR __LastUpdate = MAX('FTE_2019-2020'[Fecha extracción])
VAR __CurrentVacant = CALCULATE([Count Vacant];Calendario[Year]=YEAR(__LastUpdate);Calendario[#Month]=MONTH(__LastUpdate))
RETURN
    __CurrentVacant

 

 

The measure, in general terms, is working, I use it on a card and shows the proper value, however, when I use it on a chart is showing an extra value from a different month. For example, right now my Card is showing 8, there is a table in which I can see the 8 values detail info, but the chart is showing a total of 9, for some reason is adding one value from a different month.

 

Measure on cardMeasure on card

 

Table.png

Chart.png

I selected on of the options in the chart (Other) and then the table showed me the aditional value, is a register from 2020-2 that should not be included in the measure since is not from the last updated month.

 

If you have any idea on how to correct this or what could be happening I would really appreciate it.

 

Thank you in advance.

 

 

1 ACCEPTED SOLUTION
Eyelyn9
Community Support
Community Support

Hi @yfquirogah ,

 

Accoring to my understanding , you don't want to display value shown below ,right?

12.11.6.1.PNG

You could try this:

Measure =
VAR _max =
    CALCULATE ( MAX ( 'FTE_2019-2020'[Fecha extracción] ), ALL ( 'FTE_2019-2020' ) )
RETURN
    IF (
        YEAR ( MAX ( 'FTE_2019-2020'[Fecha extracción] ) ) = YEAR ( _max )
            && MONTH ( MAX ( 'FTE_2019-2020'[Fecha extracción] ) ) = MONTH ( _max ),
        [Current Vacants],
        0
    )

Then set the following column as X-axis, the final output looks like this:

YearMonth =
YEAR ( [Fecha extracción] ) & "-"
    & MONTH ( 'FTE_2019-2020'[Fecha extracción] )

12.11.6.2.PNG

Here is the pbix file.

 

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

 

Best Regards,
Eyelyn Qin

View solution in original post

3 REPLIES 3
Eyelyn9
Community Support
Community Support

Hi @yfquirogah ,

 

Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it.

 

Best Regards,
Eyelyn Qin

Eyelyn9
Community Support
Community Support

Hi @yfquirogah ,

 

Accoring to my understanding , you don't want to display value shown below ,right?

12.11.6.1.PNG

You could try this:

Measure =
VAR _max =
    CALCULATE ( MAX ( 'FTE_2019-2020'[Fecha extracción] ), ALL ( 'FTE_2019-2020' ) )
RETURN
    IF (
        YEAR ( MAX ( 'FTE_2019-2020'[Fecha extracción] ) ) = YEAR ( _max )
            && MONTH ( MAX ( 'FTE_2019-2020'[Fecha extracción] ) ) = MONTH ( _max ),
        [Current Vacants],
        0
    )

Then set the following column as X-axis, the final output looks like this:

YearMonth =
YEAR ( [Fecha extracción] ) & "-"
    & MONTH ( 'FTE_2019-2020'[Fecha extracción] )

12.11.6.2.PNG

Here is the pbix file.

 

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

 

Best Regards,
Eyelyn Qin

View solution in original post

AlB
Super User III
Super User III

Hi @yfquirogah 

Can you share the pbix?

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.