cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Common date axis

Hi guys,

 

I am working on a consignment report. One of the data set is as below. I wish to see a simple graph containing No. of goods issued, invoiced and returned in each month.

I created a date table and linked it to the dates mentioned above. However, only one relationship can be active right and that's goods issue at the moment.

 

Now when I plot Date on x axis against goods issue date, invoice date, return date on Y axis, I get correct GI date entries and corresponding invoice date, return date entries. I kind of understand why this is happening but not able to figure out  how do I get, no. of invoices, returns in every month regardless when they were issued.

 

Any help would be much appreciated. Thanks!

 

Regards,

Shaheen

shaheen_taori_0-1593673828364.png

 
 

PBI_query_1.jpg

PBI_query_2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Common date axis

Hi @shaheen_taori 

Create a date table but don't create a relationship between date table and your table.

Date = ADDCOLUMNS(CALENDARAUTO(),"year-month",FORMAT([Date],"YYYY Mmm"),"y-m",FORMAT([Date],"yyyy-mm"))

add columns
start_month = STARTOFMONTH('Date'[Date])
end_month = ENDOFMONTH('Date'[Date])

Create measures

good_issue =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Good Issue Date] >= MIN ( 'Date'[start_month] )
            && 'Table'[Good Issue Date] <= MAX ( 'Date'[end_month] )
    )
)

invoice =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Invoice Date] >= MIN ( 'Date'[start_month] )
            && 'Table'[Invoice Date] <= MAX ( 'Date'[end_month] )
    )
)


return =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Return Date] >= MIN ( 'Date'[start_month] )
            && 'Table'[Return Date] <= MAX ( 'Date'[end_month] )
    )
)

Capture2.JPG

Best Regards
Maggie
Community Support Team _ Maggie 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

2 REPLIES 2
Highlighted
Super User IX
Super User IX

Re: Common date axis

@shaheen_taori , So if date table and Join it multiple dates only one is active. So it will only run on an active date. So if the invoice date is active all data is by active date.

 

So if we want to change the date we need to use userelation . So that invoices run by invoice date, the issue will run by issue date.

 

Refer to this example how to use

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Highlighted
Community Support
Community Support

Re: Common date axis

Hi @shaheen_taori 

Create a date table but don't create a relationship between date table and your table.

Date = ADDCOLUMNS(CALENDARAUTO(),"year-month",FORMAT([Date],"YYYY Mmm"),"y-m",FORMAT([Date],"yyyy-mm"))

add columns
start_month = STARTOFMONTH('Date'[Date])
end_month = ENDOFMONTH('Date'[Date])

Create measures

good_issue =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Good Issue Date] >= MIN ( 'Date'[start_month] )
            && 'Table'[Good Issue Date] <= MAX ( 'Date'[end_month] )
    )
)

invoice =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Invoice Date] >= MIN ( 'Date'[start_month] )
            && 'Table'[Invoice Date] <= MAX ( 'Date'[end_month] )
    )
)


return =
CALCULATE (
    COUNTROWS ( 'Table' ),
    FILTER (
        ALLSELECTED ( 'Table' ),
        'Table'[Return Date] >= MIN ( 'Date'[start_month] )
            && 'Table'[Return Date] <= MAX ( 'Date'[end_month] )
    )
)

Capture2.JPG

Best Regards
Maggie
Community Support Team _ Maggie 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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Upcoming Events

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors