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
Clout
Helper III
Helper III

Show points/line in a line chart only for a certain time period

Hello,

 

I have two tables:

 

Table [Concentration]

 

Date / Nges

1.1 / 5

2.1 / 10

3.1 / 8

4.1 / 20

 

Table [Global]

 

GW Nges

10

 

So table Global only consists of one row as a limit value

 

 

So now I want to visualise the table Concentration over the time with a line chart and visualise the limit value GW Nges as well. Thats no problem, but I want to visualise the limit value "GW Nges" only for a certain perdiod in the year. From the 01.05 till 01.11.

But not only for one specific year, it should be transferable for every year. So when i visualise the years 2018 to 2021, the limit should be only visible within the certain time period.

 

Id like to have something like that:

Unbenannt.PNG

I think its possible with a DAX measure, but this need exceeds my skills. I appreciate any help.

 

 

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @Clout ,

You can just set the limitations for the month and days in the measure:

Gw Nges =
VAR _date =
    SELECTEDVALUE ( Concentration[Date] )
RETURN
    IF (
        MONTH ( _date ) = 1
            && DAY ( _date ) >= 5
            && DAY ( _date ) <= 11,
        SUM ( 'Global'[GW Nges] )
    )

Use a Line chart and change some settings for it to show the result.

Adjust data color in Data colors tab:

color.png

Under Shapes tab:

Shape.png

Result:

re.png

Attached a sample file in the below, hopes it could help.

 

Best Regards,
Community Support Team _ Yingjie Li
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

4 REPLIES 4
amitchandak
Super User
Super User

@Clout , Try a measure like

if(max([date]) >=date(2020,05,01) && max([date]) <=date(2020,11,01) , sum(Global[GW Nges]), blank())

Hello @amitchandak 

 

thank you, this works for the year 2020. But is it possible to doesn't exclude the other years? So is it possible to dont set a specific year and visualise the limit for the year 2019, 2021 and in the future for 2022, 2023 etc. too?

v-yingjl
Community Support
Community Support

Hi @Clout ,

You can just set the limitations for the month and days in the measure:

Gw Nges =
VAR _date =
    SELECTEDVALUE ( Concentration[Date] )
RETURN
    IF (
        MONTH ( _date ) = 1
            && DAY ( _date ) >= 5
            && DAY ( _date ) <= 11,
        SUM ( 'Global'[GW Nges] )
    )

Use a Line chart and change some settings for it to show the result.

Adjust data color in Data colors tab:

color.png

Under Shapes tab:

Shape.png

Result:

re.png

Attached a sample file in the below, hopes it could help.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-yingjl 

thank your for your suggestion, it helped me very much to get on the solution!

 

My data format is DD/MM/YYYY, and your suggestion holds only the 1th Month and the the 5th and 11th Day. (I think there was a little misunterstanding between the different data formats, I should hint at it). But I wanted the limit to be visible for the beginning of the  5th Month till the 11th Month.

 

So my solution looks now like this:

 

Gw Nges =
VAR _date =
SELECTEDVALUE ( Frachten[Datum] )
RETURN
IF (
MONTH ( _date ) >= 5 && MONTH( _date) <= 11
&& DAY ( _date ) = 1
 
, MAX('Global'[GW_AblaufNges]))

 

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.