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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
PauloRicardo
Advocate I
Advocate I

Unexpected Results with Date metrics

Hi,

Any tips on why does only one person / result appears when i try to visualize the payment Increase metric using date as my X axis?

Captura de tela 2025-01-15 172729.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


In the table, the calculation gives the right sum, based on the filtered months of october and november. 
In the line Chart, insted of the totals for each month, the chart returns only a few raises.

Which of my measures is returning the unexpected results?

By the way, if some of you guys know a way to make the measure faster, i'd be grateful.

Thx!

PBI Archive Here.

1 ACCEPTED SOLUTION

I've added 'DATE'[Date] to the summarize and worked... Weirdly enough, i've tried before and didn't resulted in the desired output. Well... sometimes we think about all the possible choices and forget the simpler ones...

Payment Increase =
VAR __Table =
    FILTER (
        SUMMARIZE ( SALARY_HISTORY, SALARY_HISTORY[EMPLOYEE_ID], 'DATE'[Date] ),
        NOT ( ISBLANK ( [Date Last Salary] ) )
    )
VAR __DifSal =
    SUMX ( __Table, [Current - Last Salary] )
RETURN
    __DifSal

PauloRicardo_0-1737037955625.png

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi,@PauloRicardo .I am glad to help you.
The logic of your calculation seems to be fine, I think it's due to the fact that too little sample data is successfully being filtered out that
The result is that for each employee_id, after selecting multiple month splits, valid data exists for only one of the months.
Therefore it is displayed as a dot instead of a line with valid data for multiple months.
I performed the following test:
Re-created a table visual and added the field [Month Name] that receives the slicer's influence
At this point the table and the line chart received the same filtering effect.
You can see that when I select the slicer, the table shows the correct data, but you can see that for the same month, none of the records have the same employee_id.
The equivalent of each data in the MEASURE is a single value for aggregation (at this point the calculation is correct, but the return in the line chart is a dot because there is only one Payment Increase for each employee_id in the table for the same month)

vjtianmsft_1-1737008369117.png


like this:
It's when I filter the slicer after the corresponding aggregated values exist for each Attribute for different Year Months that the data is displayed as a line image, not as a single aggregated point

vjtianmsft_2-1737008408562.png

So I don't think there is a problem with your code per se, you can try to modify the data to make sure that after slicer filtering, there are corresponding values for multiple different Months


I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

I've added 'DATE'[Date] to the summarize and worked... Weirdly enough, i've tried before and didn't resulted in the desired output. Well... sometimes we think about all the possible choices and forget the simpler ones...

Payment Increase =
VAR __Table =
    FILTER (
        SUMMARIZE ( SALARY_HISTORY, SALARY_HISTORY[EMPLOYEE_ID], 'DATE'[Date] ),
        NOT ( ISBLANK ( [Date Last Salary] ) )
    )
VAR __DifSal =
    SUMX ( __Table, [Current - Last Salary] )
RETURN
    __DifSal

PauloRicardo_0-1737037955625.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.