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