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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

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
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

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
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

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.

amitchandak
Super User
Super User

@Anonymous , 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-trend/ba-p/882970

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors