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.
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
Solved! Go to Solution.
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] )
)
)
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.
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] )
)
)
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.
@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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |