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
mejiaks
Frequent Visitor

Trend line chart

HI

 

I have a dataset with several rows showing 1 order per row

 

I need to show a chart showing Total orders per week, something like this

trend.JPG

I have a measure that counts the orders on  a selected week, but when i try to ue it on the chart, it shows the wrong data

 

Orders Week = CALCULATE(DISTINCTCOUNT(TruckingData[OrderNO]),FILTER(TruckingData,TruckingData[RevType] <> "EREPO" && WEEKNUM(TruckingData[Book Date])=TruckingData[Current Week]))+ 0

 

what am i doing wrong?

1 ACCEPTED SOLUTION
Eric_Zhang
Employee
Employee

@mejiaks

Try to create a calendar table

Capture.PNG

 

Then link your table with this calendar table.

Capture.PNG

 

Then remove one filter in your measure.

Orders Week =
CALCULATE (
    DISTINCTCOUNT ( TruckingData[OrderNO] ),
    FILTER (
        TruckingData,
        TruckingData[RevType] <> "EREPO"
            
    )
)
    + 0

In the line chart, put the 'Dimdate'[weeoNo] as axis and the measure as value. 

View solution in original post

2 REPLIES 2
Eric_Zhang
Employee
Employee

@mejiaks

Try to create a calendar table

Capture.PNG

 

Then link your table with this calendar table.

Capture.PNG

 

Then remove one filter in your measure.

Orders Week =
CALCULATE (
    DISTINCTCOUNT ( TruckingData[OrderNO] ),
    FILTER (
        TruckingData,
        TruckingData[RevType] <> "EREPO"
            
    )
)
    + 0

In the line chart, put the 'Dimdate'[weeoNo] as axis and the measure as value. 

Tnx @Eric_Zhang

 

Your solution works. I implemented my own though

 

I created a Calculated Column

 

Week 2 = WEEKNUM(TruckingData[Book Date]) 

 

and I did this with the chart

 

Capture.JPG

 

it displays the data as it should

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.