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

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.

Reply
Anonymous
Not applicable

Split query into 1 table with 4 areas

I have a query which in the area it has values of 

 

project           Area

1                     ncsa

2                    mena

3                    apac

4                    earc

5                    ncsa

 

 

I would like to split each row based on the area into a table that counts the number of projects based on the area. for example,

 

table 1

 

# of projects in area                  area

5                                                mena

3                                                apac

 

how can I split my query or use DAX to create a new table

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @Anonymous 

The example is a bit confusing. I'm not sure I understand correctly. Create a new calculated table:

NewTable =
ADDCOLUMNS (
    DISTINCT ( Table1[Area] ),
    "NumProjects", CALCULATE ( COUNT ( Table1[project] ) )
)

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

View solution in original post

2 REPLIES 2
AlB
Super User
Super User

Hi @Anonymous 

The example is a bit confusing. I'm not sure I understand correctly. Create a new calculated table:

NewTable =
ADDCOLUMNS (
    DISTINCT ( Table1[Area] ),
    "NumProjects", CALCULATE ( COUNT ( Table1[project] ) )
)

Please mark the question solved when done and consider giving kudos if posts are helpful.

Cheers  Datanaut

jdbuchanan71
Super User
Super User

You can get the count of uniqe projects using this measure.

# of projects in area = DISTINCTCOUNT ( YourTable[project] )

Then you would add the area and that measure into a table visual to get the project count by area.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.