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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Julio-YYC
Helper II
Helper II

How to show an specific value in a line chart?

Hello everyone,

I have a line chart, and when I click on a specific date, my card will show the value for that day, like this: 

 

Clicking on Oct-02, Card shows 5 (that's okay!)

JulioYYC_0-1666550871218.png

However, when all the dates are select in the chart, the card shows the total count (20):

JulioYYC_1-1666550946000.png

But what I want to see in the card is only the last value (6) instead of 20 when I am selecting all the dates.

 

Does anybody know how to get it solved in Power BI? 

 

 

JulioYYC_2-1666551179714.png

 

 

Many thanks

 

Julio

 

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Julio-YYC ,

sorry, i understood wrong.

Here are the steps you can follow:

1. Create measure.

Measure =
var _select=SELECTCOLUMNS('Table',"1",[Day])
var _maxdate=MAXX(ALL('Table'),[Day])
return
IF(
_maxdate in _select,
SUMX(FILTER(ALL('Table'),'Table'[Day]=_maxdate),[Value]),
SUMX(FILTER(ALL('Table'),'Table'[Day] in _select),[Value]))

2. Result:

vyangliumsft_0-1666742752516.png

 

Best Regards,

Liu Yang

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

View solution in original post

6 REPLIES 6
v-yangliu-msft
Community Support
Community Support

Hi  @Julio-YYC ,

sorry, i understood wrong.

Here are the steps you can follow:

1. Create measure.

Measure =
var _select=SELECTCOLUMNS('Table',"1",[Day])
var _maxdate=MAXX(ALL('Table'),[Day])
return
IF(
_maxdate in _select,
SUMX(FILTER(ALL('Table'),'Table'[Day]=_maxdate),[Value]),
SUMX(FILTER(ALL('Table'),'Table'[Day] in _select),[Value]))

2. Result:

vyangliumsft_0-1666742752516.png

 

Best Regards,

Liu Yang

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

I Appreciate that Liu Yang, it's working perfectly.. many thanks!

v-yangliu-msft
Community Support
Community Support

Hi  @Julio-YYC ,

Here are the steps you can follow:

1. Create measure.

Measure =
var _elect=SELECTCOLUMNS('Table',"1",[Day])
return
SUMX(FILTER(ALL('Table'),'Table'[Day] in _elect),[Value])

2. Result:

Select Single

vyangliumsft_0-1666686708882.png

Select all

vyangliumsft_1-1666686708887.png

If you need pbix, please click here.

 

Best Regards,

Liu Yang

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

Hi Liu, 

Actually, when selecting all the chart, I need to show "6" on the card (the latest date available on Oct-05) instead of 20.

mangaus1111
Solution Sage
Solution Sage

Hi @Julio-YYC ,

 

try this

Measure = CALCULATE(
                   MIN('Facts26'[Value]),
                   'Facts26'[Day] = MAX('Facts26'[Day])
)
 
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Mangaus, 

The solution from Liu worked better for me...anyways, thanks for helping!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.