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.
I am relatively new to Power BI.
I have a table of orders as shown here. I would like a *single* chart that represents bar graph of counts with date on X-axis.
order ID | order date | warehouse process date | ship date |
1 | 4/1 | 4/1 | 4/2 |
2 | 4/1 | 4/2 | 4/4 |
3 | 4/1 | 4/3 | 4/4 |
4 | 4/2 | 4/2 | 4/10 |
5 | 4/2 | 4/3 | 4/4 |
6 | 4/3 | 4/4 | 4/5 |
What attribute should I use in the X-Axis and how do I get counts of each of the states on specific days?
Thanks much in advance!!
Solved! Go to Solution.
Hello @vips ,
This you can achieve through making a separate calendar table:
dtCalendar =
ADDCOLUMNS(
CALENDARAUTO(),
"Year", YEAR([Date]),
"Month", EOMONTH([Date],-1)+1
)
then creating relationship between the Date of calendar table and all three dates from your fact table (one active and two inactive):
Add three measures:
Count by Order Date =
COUNTROWS(dtTable)
Count by Process Date =
CALCULATE(
[Count by Order Date],
USERELATIONSHIP(dtCalendar[Date],dtTable[warehouse process date])
)
Count by Ship Date =
CALCULATE(
[Count by Order Date],
USERELATIONSHIP(dtCalendar[Date],dtTable[ship date])
)
Select Date from the calendar table and add these meausres in the visual:
You may find the solution pbix file here
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂
https://www.vivran.in/
Connect on LinkedIn
Create a common Date Calendar table. Join all three dates with it. There will one active and and two inactive relations. use userelation to activate joins.
example
Ordered = CALCULATE(COUNT(Table[Order Id ]),USERELATIONSHIP(Table[Order Date],'Date'[Date]) )
warehouse = CALCULATE(COUNT(Table[Order Id ]),USERELATIONSHIP(Table[warehouse process Date],'Date'[Date]) )
Ship = CALCULATE(COUNT(Table[Order Id ]),USERELATIONSHIP(Table[Ship Date],'Date'[Date]) )
Refer my blog how to use : https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
Create a common Date Calendar table. Join all three dates with it. There will one active and and two inactive relations. use userelation to activate joins.
example
Ordered = CALCULATE(COUNT(Table[Order Id ]),USERELATIONSHIP(Table[Order Date],'Date'[Date]) )
warehouse = CALCULATE(COUNT(Table[Order Id ]),USERELATIONSHIP(Table[warehouse process Date],'Date'[Date]) )
Ship = CALCULATE(COUNT(Table[Order Id ]),USERELATIONSHIP(Table[Ship Date],'Date'[Date]) )
Refer my blog how to use : https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
Thanks!
Hello @vips ,
This you can achieve through making a separate calendar table:
dtCalendar =
ADDCOLUMNS(
CALENDARAUTO(),
"Year", YEAR([Date]),
"Month", EOMONTH([Date],-1)+1
)
then creating relationship between the Date of calendar table and all three dates from your fact table (one active and two inactive):
Add three measures:
Count by Order Date =
COUNTROWS(dtTable)
Count by Process Date =
CALCULATE(
[Count by Order Date],
USERELATIONSHIP(dtCalendar[Date],dtTable[warehouse process date])
)
Count by Ship Date =
CALCULATE(
[Count by Order Date],
USERELATIONSHIP(dtCalendar[Date],dtTable[ship date])
)
Select Date from the calendar table and add these meausres in the visual:
You may find the solution pbix file here
Cheers!
Vivek
If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂
https://www.vivran.in/
Connect on LinkedIn
Thanks!
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 |
---|---|
109 | |
99 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |