Forum Discussion
Creating Dynamic Y-axis Values
- 1 year ago
Hi nandipk
I am assuming your table having this columns NCEP No, initiation_date, and ncep_closed_date
--> Create a date table based on initiation_date column.
--> Then add a claculated column to this date table to get year number and week number
YearWeekNo = YEAR([Date]) & "-" & WEEKNUM([Date], 2)--> Then create a measure to count the number of NCEPs open at the start of each week
OpenNCEPs = CALCULATE(COUNTROWS('NCEP Table'), 'NCEP Table'[initiation_date] <= MAX('Date'[Date]) && (ISBLANK('NCEP Table'[ncep_closed_date]) || 'NCEP Table'[ncep_closed_date] > MAX('Date'[Date])))--> Then create one more measure to count the number of new NCEPs opened in each week
NewNCEPs = CALCULATE(COUNTROWS('NCEP Table'), 'NCEP Table'[initiation_date] >= MIN('Date'[Date]) && 'NCEP Table'[initiation_date] <= MAX('Date'[Date]))--> Then take stacked barchart drag YearWeek calcuated column to X-axis from date table. Drag OpenNCEPs and NewNCEPs on Y-axis
Let me know if it works
Hi nandipk
I am assuming your table having this columns NCEP No, initiation_date, and ncep_closed_date
--> Create a date table based on initiation_date column.
--> Then add a claculated column to this date table to get year number and week number
YearWeekNo = YEAR([Date]) & "-" & WEEKNUM([Date], 2)
--> Then create a measure to count the number of NCEPs open at the start of each week
OpenNCEPs =
CALCULATE(COUNTROWS('NCEP Table'),
'NCEP Table'[initiation_date] <= MAX('Date'[Date]) &&
(ISBLANK('NCEP Table'[ncep_closed_date]) || 'NCEP Table'[ncep_closed_date] > MAX('Date'[Date])))--> Then create one more measure to count the number of new NCEPs opened in each week
NewNCEPs =
CALCULATE(COUNTROWS('NCEP Table'),
'NCEP Table'[initiation_date] >= MIN('Date'[Date]) &&
'NCEP Table'[initiation_date] <= MAX('Date'[Date]))--> Then take stacked barchart drag YearWeek calcuated column to X-axis from date table. Drag OpenNCEPs and NewNCEPs on Y-axis
Let me know if it works