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.
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
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |