Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Dear All,
I am new to Power BI/DAX world. I want to add a column in table named Test PR POS ONLY. The name of column is Count of POs. My DAX command is given below: (which is not giving correct no.)
Count of POS =
VAR TotalRowsTestprTable = COUNTROWS('test pr')
RETURN CALCULATE(TotalRowsTestprTable, FILTER('test pr', 'test pr'[PO Date].[Date]='test pr POS ONLY'[PR Date].[Date]))
1. Test Pr table is as below
| PR No. | PR Date | PO Date | PO No |
| 10 | 01/01/2020 | 01/01/2020 | 110 |
| 20 | 02/01/2020 | 05/01/2020 | 120 |
| 30 | 03/01/2020 | 06/01/2020 | 130 |
| 40 | 04/01/2020 | 07/01/2020 | 140 |
| 50 | 05/01/2020 | 08/01/2020 | 150 |
| 60 | 06/01/2020 | 11/01/2020 | 160 |
| 70 | 07/01/2020 | 07/01/2020 | 170 |
| 80 | 08/01/2020 | 11/01/2020 | 180 |
| 90 | 09/01/2020 | 15/02/2020 | 190 |
2. My Test PR POs ONLY table is as below
| PR Date | Count of POs |
| 01/01/2020 | 20 |
| 02/01/2020 | 20 |
| 03/01/2020 | 20 |
| 04/01/2020 | 20 |
| 05/01/2020 | 20 |
| 06/01/2020 | 20 |
| 07/01/2020 | 20 |
| 08/01/2020 | 20 |
| 09/01/2020 | 20 |
3. The above no. 20 (which is wrong) is calculated as a result of my DAX command
4. i have 1 to many relation between Test PR POS ONLY table and Test PR tables
Please help where am i making the mistake. Thanks ifti1970@gmail.com
@Anonymous ,
New Table =summarize('Test Pr','Test Pr'[PR Date],"Count of POs", Count('Test Pr'[PO No]))
New column in the table
Count of POs = countrows(related('Test Pr'[PO No])) //only when it is 1 to M-HIPOTPol
or
Count of POs = countx(filter('Test Pr', 'Test Pr'[PR Date] = 'Test PR POs'[PR Date]),'Test Pr'[PO No])
@Anonymous I believe all you should need is:
COUNTROWS(RELATEDTABLE('Table1'))
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 17 | |
| 14 | |
| 13 |