Thanks for your response.
I would like to display the three curves, but only the measues af the current month, am I clear? please execuse my bad english
Dis u mean to say measure values only for current month?
If this is what u want ,then i am afraid this is not possible in tableau.
Wiem, you could do this as a dual-axis chart, with current month on one axis and all previous months on the other, then enable Labels only for the current month axis.
You need to create 2 new fields for your Calcul 3 value, one that displays only the current month, and one that displays the previous 2 months.
The way I did it creates a problem with the color legend but I don't have time right now to clean this up. Perhaps the attached will give you a starting point, however.
BekirSample.twbx 1.2 MB
Hi wiem bekir, do you mean the values marks on the line? If so, click onto the 'Labels' box on the left hand menu and select the option which shows 'Line ends' instead of 'All' - this will only show the values on the most recent mark. Is this what are are looking for?
Hope that helps,
Wiem, what Ben and Zach are suggesting will work, but it won't get you the result you're looking for.
Each line in your graph is a Month, correct? And the points are the Days in the month? What Ben and Zach suggest will show the value for each "Last Day" of the month, which is not what you want. In your example, you only want values to show for the PURPLE line (juin), but for all points on that line.
Or am I misunderstanding?
Create one calculated field with logic as below-
IF DATEPART('month',[Date field] ) = [Month] or DATEPART('month',[Date Field] ) = [Month] -1 then
in report filters filter with "Y"
These are all great solutions but you don't actually need to write a calc to display labels for the most recent month only. Tableau's label shelf can help you with it.
create the viz with day on columns and your measure on rows. Month on color.
add the measure to "labels"
click on the label shelf, and select the option "marks to label" > "min/max"
select "scope": Table and "field": Month. Then only select the checkbox for "label maximum value"
should look like this:
Voila! no calcs required.
label last month only.twbx 1.3 MB
Nice! I always forget how much control there is in that Label mark. Thank you for the reminder, Charles!