March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
134 | |
91 | |
90 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
72 | |
68 |