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
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
v-eqin-msft
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
v-eqin-msft
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

v-eqin-msft
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

AlB
Super User
Super User

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

Top Solution Authors