Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
alan19
Frequent Visitor

help with roll up line chart

Hi, 

Using these two functions I did calcolated running totals daily and monthly and filter for weekly but when plot them in a line chart, the month turns into days when choosing days for X axis, How can i plot them in a line chart and lines remain monthly and daily each:  

RolleUp Month =
VAR Period =
DATESINPERIOD(
'Date'[Date],
MAX('Date'[Date]),
-12,
MONTH
)
VAR totalSales =
CALCULATE(
[Total Sales],
Period
)
RETURN
totalSales

 

RolleUp Day =
VAR Period =
DATESINPERIOD(
'Date'[Date],
MAX('Date'[Date]),
-365,
DAY
)
VAR TotalSales =
CALCULATE(
[Total Sales],
Period
)
RETURN
TotalSales

1 ACCEPTED SOLUTION
ronaldbalza2023
Continued Contributor
Continued Contributor

Hi @alan19 , could you try this measure see if it fits on your requirements.

RolledUp Month =
VAR Period =
    DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -12, MONTH)
VAR TotalSales =
    CALCULATE([Total Sales], Period)
RETURN
    TotalSales

RolledUp Day =
VAR Period =
    DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -365, DAY)
VAR TotalSales =
    CALCULATE([Total Sales], Period)
RETURN
    TotalSales

View solution in original post

1 REPLY 1
ronaldbalza2023
Continued Contributor
Continued Contributor

Hi @alan19 , could you try this measure see if it fits on your requirements.

RolledUp Month =
VAR Period =
    DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -12, MONTH)
VAR TotalSales =
    CALCULATE([Total Sales], Period)
RETURN
    TotalSales

RolledUp Day =
VAR Period =
    DATESINPERIOD('Date'[Date], MAX('Date'[Date]), -365, DAY)
VAR TotalSales =
    CALCULATE([Total Sales], Period)
RETURN
    TotalSales

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.