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
kdaya
Helper I
Helper I

How to view trends over time for first n number for days

Hi

 

How do i get a line graph to show the first n number of days rather than actually a date range

 

Please can someone help me out,

 

Thanks

Kunal

1 ACCEPTED SOLUTION
Eric_Zhang
Employee
Employee


@kdaya wrote:

Hi

 

How do i get a line graph to show the first n number of days rather than actually a date range

 

Please can someone help me out,

 

Thanks

Kunal


A measure as below for your reference, the measure varies according to the N days in a slicer. See more details in the attached pbix file.

First N Days value =
SUMX (
    FILTER (
        ALL ( 'values' ),
        'values'[date] <= MAX ( 'values'[date] )
            && 'values'[date]
                >= MAX ( 'values'[date] ) - MAX ( 'First N Days'[N] )
    ),
    'values'[values]
)

Capture.PNG

View solution in original post

2 REPLIES 2
Eric_Zhang
Employee
Employee


@kdaya wrote:

Hi

 

How do i get a line graph to show the first n number of days rather than actually a date range

 

Please can someone help me out,

 

Thanks

Kunal


A measure as below for your reference, the measure varies according to the N days in a slicer. See more details in the attached pbix file.

First N Days value =
SUMX (
    FILTER (
        ALL ( 'values' ),
        'values'[date] <= MAX ( 'values'[date] )
            && 'values'[date]
                >= MAX ( 'values'[date] ) - MAX ( 'First N Days'[N] )
    ),
    'values'[values]
)

Capture.PNG

Omega
Impactful Individual
Impactful Individual

You can apply a visual filter. 

 

Click on the line chart -> Go to filter section under your visuals -> Change the Filter Type to Top N -> Drag your date column to By Value and enter the number of day you want to see. 

 

TOP N Dates.PNG

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.