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.
Hello,
I have the below two source tables
DocDetail
BeginFlag | DoC | UsageCount | ValueDate | DocName |
Yes | 20 | NULL | 6/3/2019 | Steve |
No | 2 | NULL | 6/4/2019 | Steve |
No | 10 | 2 | 6/5/2019 | Steve |
Yes | 25 | NULL | 7/6/2019 | Mark |
No | 67 | NULL | 7/7/2019 | Mark |
No | 45 | 2 | 7/8/2019 | Mark |
No | 34 | NULL | 7/9/2019 | Mark |
No | 76 | NULL | 7/10/2019 | Steve |
No | 77 | NULL | 7/11/2019 | Mark |
Yes | 88 | NULL | 8/12/2019 | John |
No | 9 | 1 | 8/13/2019 | John |
No | 4 | NULL | 8/14/2019 | John |
No | 34 | NULL | 8/15/2019 | John |
No | 34 | 2 | 8/16/2019 | John |
No | 67 | NULL | 8/17/2019 | John |
Yes | 66 | NULL | 9/18/2019 | Mary |
No | 44 | 1 | 9/19/2019 | Mary |
No | 88 | NULL | 9/20/2019 | Mary |
No | 57 | 1 | 9/21/2019 | Mary |
No | 35 | NULL | 9/22/2019 | Mary |
No | 35 | 2 | 9/23/2019 | Mary |
Yes | 23 | 5 | 9/24/2019 | John |
No | 45 | NULL | 9/25/2019 | Mary |
The ValueDate is linked to the Date table as..
YearMonth | Datevalue |
201906 | 6/3/2019 |
201906 | 6/4/2019 |
201906 | 6/5/2019 |
201907 | 7/6/2019 |
201907 | 7/7/2019 |
201907 | 7/8/2019 |
201907 | 7/9/2019 |
201907 | 7/10/2019 |
201907 | 7/11/2019 |
201908 | 8/12/2019 |
201908 | 8/13/2019 |
201908 | 8/14/2019 |
201908 | 8/15/2019 |
201908 | 8/16/2019 |
201908 | 8/17/2019 |
201909 | 9/18/2019 |
201909 | 9/19/2019 |
201909 | 9/20/2019 |
201909 | 9/21/2019 |
201909 | 9/22/2019 |
201909 | 9/23/2019 |
201909 | 9/24/2019 |
201909 | 9/25/2019 |
The Goal is to end with
YearMonth | NetUsageCount | DocValue | DocName |
201906 | 2 | 20 | Steve |
201907 | 2 | 25 | Mark |
201908 | 3 | 88 | John |
201909 | 4 | 66 | Mary |
201909 | 5 | 23 | John |
I am to capture the DocValue where the BeginFlag = yes for that Doc , but the Netusage count must be the sum for that month again for that Doc. I tried using All except as below
NetUsageCount = Calculate(sum(Docdetail[UsageCount]), allexcept(DateTable, DateTable[YearMonth]), AllExcept(Docdetail[Docname]))
But the Usage count is getting 16 for everybody. Please advise on how to fix this.
Thank you @CNENFRNL happy Camper was I , as your solution worked , until the specifications got changed and it now does work because of attached file and now it doesnt work. https://file.re/2021/06/17/book2/
The differences are, DocID Count, is the count of DocId's that have a begin flag = yes, but the UsageSum, is the sum of UsageCount field for only those DocID's that have a Yes. So even though A9021 has a value of 6, it should not be counted, because it does have a yes Flag. Likewise, D2025 is counted/summed for 2/1 and 2/2 because it had a Yes for 2/1.
Any help please.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
@CNENFRNL . Please look at the file at this link. When using your code, it is not working as the requirements were modified as per below.
The differences are, DocID Count, is the count of DocId's that have a begin flag = yes, but the UsageSum, is the sum of UsageCount field for only those DocID's that have a Yes. So even though A9021 has a value of 6, it should not be counted, because it does have a yes Flag. Likewise, D2025 is counted/summed for 2/1 and 2/2 because it had a Yes for 2/1.
Would you be able to provide a recommeded solution for this. https://file.re/2021/06/18/book2/
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |