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.
Region | Total Sites | Expected Assets | Pending Sites |
North | 3 | 75 | 1 |
South | 2 | 50 | 1 |
East | 1 | 25 | 1 |
West | 5 | 125 | 3 |
Sample Data:
Locations[id] | Locations[Region] | Locations[SiteCount] | Locations[Status] |
1 | North | 25 | |
2 | North | 25 | Complete |
3 | North | 25 | Complete |
4 | South | 25 | |
5 | South | 25 | Complete |
6 | East | 25 | |
7 | West | 25 | |
8 | West | 25 | |
9 | West | 25 | |
10 | West | 25 | |
11 | West | 25 | Complete |
Assets[Location_id] | Assets[InventoryDate] |
1 | 7/4/1976 |
1 | 7/4/1976 |
1 | 7/4/1976 |
1 | 7/4/1976 |
1 | 7/4/1976 |
2 | 1/1/2023 |
2 | 1/1/2023 |
2 | 1/1/2023 |
4 | 7/4/1976 |
4 | 7/4/1976 |
4 | 7/4/1976 |
5 | 7/4/1976 |
5 | 7/4/1976 |
5 | 7/4/1976 |
5 | 7/4/1976 |
5 | 7/4/1976 |
5 | 7/4/1976 |
6 | 7/4/1976 |
6 | 7/4/1976 |
6 | 7/4/1976 |
7 | 7/4/1976 |
7 | 7/4/1976 |
7 | 7/4/1976 |
7 | 7/4/1976 |
8 | 7/4/1976 |
8 | 7/4/1976 |
8 | 7/4/1976 |
8 | 7/4/1976 |
9 | 7/4/1976 |
9 | 7/4/1976 |
9 | 7/4/1976 |
9 | 7/4/1976 |
10 | 1/1/2023 |
10 | 1/1/2023 |
10 | 1/1/2023 |
10 | 1/1/2023 |
11 | 1/1/2023 |
11 | 1/1/2023 |
11 | 1/1/2023 |
11 | 1/1/2023 |
Solved! Go to Solution.
Hi @InventoryMan ,
Here are the steps you can follow:
1. Create calculated table.
Table =
var _column=
SELECTCOLUMNS(
FILTER(ALL(Assets),
'Assets'[InventoryDate]=DATE(1976,7,4)),"Column_ID",'Assets'[Location_id])
var _table1=
SUMMARIZE(
'Locations','Locations'[Region],
"Total Sites",COUNT('Locations'[id]),
"Expected Assets",SUM('Locations'[SiteCount]),
"Pending Sites",COUNTX(FILTER(ALL(Locations),'Locations'[id] in _column&&'Locations'[Status]<>"Complete"&&'Locations'[Region]=EARLIER('Locations'[Region])),[Region]))
return
_table1
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @InventoryMan ,
Here are the steps you can follow:
1. Create calculated table.
Table =
var _column=
SELECTCOLUMNS(
FILTER(ALL(Assets),
'Assets'[InventoryDate]=DATE(1976,7,4)),"Column_ID",'Assets'[Location_id])
var _table1=
SUMMARIZE(
'Locations','Locations'[Region],
"Total Sites",COUNT('Locations'[id]),
"Expected Assets",SUM('Locations'[SiteCount]),
"Pending Sites",COUNTX(FILTER(ALL(Locations),'Locations'[id] in _column&&'Locations'[Status]<>"Complete"&&'Locations'[Region]=EARLIER('Locations'[Region])),[Region]))
return
_table1
2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thank you for your assistance on this! I have now been learning about the provided syntax.
Desired end result, and sample datat tables added.
@InventoryMan , Try like
SUMMARIZECOLUMNS(Locations[Region],
"Total Sites", COUNT('Locations'[Id]),
"Expected Assets", SUM('Locations'[SiteCount]),
"Pending Sites", COUNT('Locations'[Id]),
Filter(Assets, Assets[InventoryDate] = DATE(1976, 7, 4) )
Filter(Locations, Locations[Status] <> 'complete')
)
refer
https://www.sqlbi.com/articles/introducing-summarizecolumns/
@amitchandak Thank you, but I still receive an error for the filter. I will add some sample data, and perhaps there is another way to accomplish what I am looking for.
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 |
---|---|
113 | |
103 | |
77 | |
66 | |
63 |
User | Count |
---|---|
142 | |
105 | |
102 | |
81 | |
68 |