Forum Discussion
FOliveira
4 years agoFrequent Visitor
How to consolidate data from 2 tables
Hi everyone, I am stil giving my first steps with PBI. I am making a report that monitors the Purchased Licenses vs. Assigned licenses for each department. Can you please help me in getting the...
- 4 years ago
1. use PQ to create a dim table to get all the combination of PART and DEPT
2. create measures
QTy purchase = sumx(FILTER('PURCHASES','PURCHASES'[Part Nr]=max('Append1'[Part Nr])&&'PURCHASES'[Dept]=max('Append1'[Dept])),PURCHASES[QTY])+0 qty assigned = COUNTAX(FILTER('ASSIGNMENT','ASSIGNMENT'[Part Nr]=max('Append1'[Part Nr])&&'ASSIGNMENT'[Dept]=max('Append1'[Dept])),'ASSIGNMENT'[Dept])+0 qty assigned = COUNTAX(FILTER('ASSIGNMENT','ASSIGNMENT'[Part Nr]=max('Append1'[Part Nr])&&'ASSIGNMENT'[Dept]=max('Append1'[Dept])),'ASSIGNMENT'[Dept])+0pls see the attachment below
FOliveira
4 years agoFrequent Visitor
Hi again Hashish,
Can you please explain this formula, and what is the coalesce function?
Quantity assigned = coalesce(COUNTROWS(Purchases),0)
The formula
Quantity purchased = coalesce(SUM(Purchases[QTY]),0)
Makes sense
Finally, do you have a solution to remove the lines with 0 Purchases and 0 Assignments?
Thank you
Ashish_Mathur
Super User
4 years agoHi,
Please red up here. - COALESCE function (DAX) - DAX | Microsoft Docs. Use filters to remove unwanted rows.