Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
gshaikh
Regular Visitor

First count the distinct id then find the row count of that count column

Hello 

 

Please see below We need 4 as an output as oracle output has 4 rows of output Request you to please find below dummy data

 

Thank you so much for help

 

Data

Orderno OrderLineNumber Shippeddate ScheduleDate
1232 4 14-11-2022 20211113
2323 6 16-11-2022 20221115
2323 5 16-11-2022 20221115
2323 7 16-11-2022 20221115
2323 8 16-11-2022 20221115
6556 6 24-11-2022 20211113
4543 7 23-11-2022 20221115
4543 8 23-11-2022 20221115

Query in oracle


SELECT COUNT(ORDERNO) CNT,
SCHEDULEDATE,
ShippedDate
FROM TABLE1
GROUP BY ORDERNO,
SCHEDULEDATE,
ShippedDate

Output In Oracle


Cnt ScheduleDate Shippeddate
1 14-11-2022 20211113
4 16-11-2022 20221115
1 24-11-2022 20211113
2 23-11-2022 20221115

Power Bi Output


4 4 Should be output as above Oracle output has 4 rows

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @gshaikh 

You can new a summarized table and then count the rows of this summarized table:

Result2 = 
 var tab=SUMMARIZE (
    'Table',
    'Table'[Orderno],
    'Table'[ScheduleDate],
    'Table'[Shippeddate],
    "Cnt", COUNT ( 'Table'[Orderno] )
)
return COUNTROWS(tab)

Best Regards,
Community Support Team _ Eason

View solution in original post

2 REPLIES 2
gshaikh
Regular Visitor

Thank you so much for help its work for me Thanks again

v-easonf-msft
Community Support
Community Support

Hi, @gshaikh 

You can new a summarized table and then count the rows of this summarized table:

Result2 = 
 var tab=SUMMARIZE (
    'Table',
    'Table'[Orderno],
    'Table'[ScheduleDate],
    'Table'[Shippeddate],
    "Cnt", COUNT ( 'Table'[Orderno] )
)
return COUNTROWS(tab)

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.