Forum Discussion
PowerNoob
3 years agoFrequent Visitor
Help with stacked columns with different x values in same data entry
I have a datset where the entries are by model / serial number. Each entry can have phase 1 and phase 2 builds with associated hours. I'm looking to create a stacked column display for model/serial b...
- 3 years ago
I solved this by:
- Creating a calender table based on week number with this DAX: Week Num Base = VAR DateStart = MINX(tblSchedule,[P1Date].[Date]) VAR DateEnd = MAXX(tblSchedule,[ShipDate].[Date]) VAR simpledatetablesonlysunday = FILTER ( ADDCOLUMNS ( CALENDAR ( DateStart, DateEnd ), "weeknum", WEEKNUM ( [Date], 1 ) ), WEEKDAY ( [Date] ) = 1 ) RETURN simpledatetablesonlysunday
- 2. Setting up a query that pulls P1 data and relating with a date key for year/work week in its own table
- 3. setting up a separate query that pulls P2 data and relating with a date key for year/work week in its own table
- 4. relating P1, P2, and work week tables by the date key
- 5. graphing on a Line and Stacked Column Chart with calendar week number on X-axis, and P1 and P2 data on Y axis.
PowerNoob
3 years agoFrequent Visitor
I solved this by:
- Creating a calender table based on week number with this DAX: Week Num Base = VAR DateStart = MINX(tblSchedule,[P1Date].[Date]) VAR DateEnd = MAXX(tblSchedule,[ShipDate].[Date]) VAR simpledatetablesonlysunday = FILTER ( ADDCOLUMNS ( CALENDAR ( DateStart, DateEnd ), "weeknum", WEEKNUM ( [Date], 1 ) ), WEEKDAY ( [Date] ) = 1 ) RETURN simpledatetablesonlysunday
- 2. Setting up a query that pulls P1 data and relating with a date key for year/work week in its own table
- 3. setting up a separate query that pulls P2 data and relating with a date key for year/work week in its own table
- 4. relating P1, P2, and work week tables by the date key
- 5. graphing on a Line and Stacked Column Chart with calendar week number on X-axis, and P1 and P2 data on Y axis.