cancel
Showing results for 
Search instead for 
Did you mean: 
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())



!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

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
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors