Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Sorry for the newbie question, but I am having trouble getting my data to aggregate from individual day level into week, month, and year levels for each of my categories. Here is an example of my data which goes over multiple years:
Date | Testing Status | Product | Location | Count |
1/1/2018 | Tested | X | HS10 | 5 |
1/1/2018 | Tested | X | AY1000 | 100 |
1/1/2018 | Untested | X | HS10 | 20 |
1/1/2018 | Untested | X | AY1000 | 20 |
1/2/2018 | Tested | Y | AB5 | 50 |
1/2/2018 | Untested | Y | AB5 | 5 |
1/2/2018 | Tested | Z | HS10 | 30 |
1/2/2018 | Untested | Z | HS10 | 5 |
I would like to show the Amount Tested and Untested By Product And Location each week, month, and year, in addition to showing the change to date of each Tested/Untested Product and Location.
I was able to get it to show the date aggregation for all products and each products but not by testing status or location.
Any help would be very apprciated. I have been trying to do this for weeks.
Solved! Go to Solution.
Hi @Anonymous ,
Hi
Firstly to create some calculated column in your fact table.
Year = YEAR('Table1'[Date])
Month = FORMAT('Table1'[Date],"mmm")
week = WEEKNUM('Table1'[Date])
Then we can create two measures to get the result as we need.
Tested = var k = FILTER(Table1,Table1[Testing Status]="Tested") return CALCULATE(SUM(Table1[Count]),ALLEXCEPT(Table1,Table1[Year],Table1[Month],Table1[week],Table1[Location],Table1[Product]),KEEPFILTERS(k))
unTested = var k = FILTER(Table1,Table1[Testing Status]="Untested") return CALCULATE(SUM(Table1[Count]),ALLEXCEPT(Table1,Table1[Year],Table1[Month],Table1[week],Table1[Location],Table1[Product]),KEEPFILTERS(k))
For mroe details, please check the pbix as attached.
Regards,
Frank
Hi @Anonymous ,
Hi
Firstly to create some calculated column in your fact table.
Year = YEAR('Table1'[Date])
Month = FORMAT('Table1'[Date],"mmm")
week = WEEKNUM('Table1'[Date])
Then we can create two measures to get the result as we need.
Tested = var k = FILTER(Table1,Table1[Testing Status]="Tested") return CALCULATE(SUM(Table1[Count]),ALLEXCEPT(Table1,Table1[Year],Table1[Month],Table1[week],Table1[Location],Table1[Product]),KEEPFILTERS(k))
unTested = var k = FILTER(Table1,Table1[Testing Status]="Untested") return CALCULATE(SUM(Table1[Count]),ALLEXCEPT(Table1,Table1[Year],Table1[Month],Table1[week],Table1[Location],Table1[Product]),KEEPFILTERS(k))
For mroe details, please check the pbix as attached.
Regards,
Frank
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
118 | |
101 | |
71 | |
61 |