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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
cdbhealy
New Member

Date format

I have a data table that has transactions for a retail business. I am wanting to make a line chart which has each year as a separate line, and then the month/day as the horizontal axis with quantity sold as the vertical axis. Ultimately I would like the line to be a running total as of the date on the horizontal axis the quantity sold year to date.  

 

transactions.JPG

 

The first problem I am having is with getting just the month-day. I was able to separate out the year from the 'SaleDay' but any time I try to just get the month-day separate I keep getting errors. I am using DirectQuery to an sql database so as the database updates the chart will update as well. So some solutions I have found on the forum have not worked because it says it is not supported by directquery.

 

Chart.JPG

If anyone has a suggestion for also get a running total (the quick measure way didn't work for me, maybe I did wrong fields) I would be very appreciative. 

1 ACCEPTED SOLUTION
vik0810
Resolver V
Resolver V

Do You have predefined values for years? If so, you can create a measure for given years current total and place them on your chart.

A measure definition could be like that:

 

2016 = CALCULATE (
    [your measure],
    FILTER (
        ALL ( Table[SaleDay] ),
        MONTH(Table[SaleDay]) <= MAX ( MONTH(Table[SaleDay]) )
            && YEAR ( Table[SaleDay] ) = 2016
    )
)

and your result would look like:

 

rt.png

View solution in original post

1 REPLY 1
vik0810
Resolver V
Resolver V

Do You have predefined values for years? If so, you can create a measure for given years current total and place them on your chart.

A measure definition could be like that:

 

2016 = CALCULATE (
    [your measure],
    FILTER (
        ALL ( Table[SaleDay] ),
        MONTH(Table[SaleDay]) <= MAX ( MONTH(Table[SaleDay]) )
            && YEAR ( Table[SaleDay] ) = 2016
    )
)

and your result would look like:

 

rt.png

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.