Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi All,
I would like the count of that entire year to remember as Day 1 count for that year,and then count should decrease as we sell that item on that particular date.
I have tried DAX measure as: Count(ID) - TOTALYTD(count(ID),datetable(date)) this is completely wrong
However, it doesnt save as Day 1. Which is something I am looking forward to solve.
Any help is appreciated thanks in advance.
Input Data:
ID | Name | Date Sold |
456 | AAA | 1/10/20 |
345 | SSS | 1/11/20 |
267 | BBB | 1/12/20 |
128 | CCC | 1/13/20 |
129 | EEE | 1/14/20 |
125 | FFF | 1/15/20 |
567 | QQQ | 1/16/20 |
678 | GGG | 12/20/19 |
Output graph expected as: LINK
Solved! Go to Solution.
@labuser1235 do you always need a current year?
Table 2 =
ADDCOLUMNS(
CALENDAR(DATE(YEAR(TODAY()), 1, 1), Max('Input Data Table'[Date Sold])),
"Count Items", CALCULATE(DISTINCTCOUNT('Input Data Table'[ID]), FILTER('Input Data Table', 'Input Data Table'[Date Sold] >= EARLIER([Date]) || ISBLANK('Input Data Table'[Date Sold]) ))
)
Hi @labuser1235
create a calculated table
Table 2 =
ADDCOLUMNS(
CALENDAR(MIN('Input Data Table'[Date Sold]), Max('Input Data Table'[Date Sold])),
"Count Items", CALCULATE(DISTINCTCOUNT('Input Data Table'[ID]), FILTER('Input Data Table', 'Input Data Table'[Date Sold] >= EARLIER([Date])))
)
then put it into chart visual
This is almost it...just one thing if there are blanks in date sold its not picking the count exactly.
Can you Just fix this one for me in the dax @az38
try
Table 2 =
ADDCOLUMNS(
CALENDAR(MIN('Input Data Table'[Date Sold]), Max('Input Data Table'[Date Sold])),
"Count Items", CALCULATE(DISTINCTCOUNT('Input Data Table'[ID]), FILTER('Input Data Table', 'Input Data Table'[Date Sold] >= EARLIER([Date]) || ISBLANK('Input Data Table'[Date Sold]) ))
)
This is giving us the count for both the years. It should give me the count specific to each year.
In the example given I have provided 2019 and 2020 data which is counting in 2020 and making it as 8. However, as per that specific year count should change.
IS that in the filter condition are we suppose to give anything where it identifies the year and change its count.
Please help me with this we are almost there @az38
maybe you need this?
I get that in visual changes,
However I am clubbing it with other things, so if i can have that specifically within the dax as count year wise it would of great help that is why I am requsesting in it. I am trying to make a filter on calculate after the count but it just doesn't take dynamically. Please help me with this @az38
@labuser1235 do you always need a current year?
Table 2 =
ADDCOLUMNS(
CALENDAR(DATE(YEAR(TODAY()), 1, 1), Max('Input Data Table'[Date Sold])),
"Count Items", CALCULATE(DISTINCTCOUNT('Input Data Table'[ID]), FILTER('Input Data Table', 'Input Data Table'[Date Sold] >= EARLIER([Date]) || ISBLANK('Input Data Table'[Date Sold]) ))
)
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |