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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
AlakarHarijan1
Frequent Visitor

Create a new table from a existing one

Hi Friends,

 

I have a table from which i have to summaris data in to new table.

The first table contains columns - client name, region, fee(Paid/Not Paid), etc.

 

Basically i want to create a new table showing the data by client wise (say for just client "A", region in the row and count of paid in the next column the count of not paid int the next column.

 

I need the dax code. Can anyone help me please.

3 REPLIES 3
v-zhenbw-msft
Community Support
Community Support

Hi @AlakarHarijan1 ,

 

Sorry for that we don’t understanding what is your desire result.

If you want to get the sum of revenue, you need to replace the sheet1[Paid Count] to sheet1[revenue]. The Power BI cannot get the sum of text type value.

 

Table =
SUMMARIZE (
    Sheet1,
    Sheet1[Region],
    "Paid Calls", COUNTX (
        FILTER (
            Sheet1,
            Sheet1[Stakeholder Code] = "UNIV"
                && Sheet1[Paid Count] = "Paid"
        ),
        Sheet1[Paid Count]
    ),
    " Not Paid Calls", COUNTX (
        FILTER (
            Sheet1,
            Sheet1[Stakeholder Code] = "UNIV"
                && Sheet1[Paid Count] = "Not Paid"
        ),
        Sheet1[Paid Count]
    ),
    "Total", COUNTX (
        FILTER ( Sheet1, Sheet1[Stakeholder Code] = "UNIV" ),
        Sheet1[Paid Count]
    ),
    " Revenue Received ", SUMX (
        FILTER (
            Sheet1,
            Sheet1[Stakeholder Code] = "UNIV"
                && Sheet1[Paid Count] = "Paid"
        ),
        Sheet1[revenue]
    )
)

 

If it doesn’t meet your requirement, could you please provide a mockup sample  based on fake data?

 

It will be helpful if you can show us the exact expected result based on the tables. Please upload your files to OneDrive For Business and share the link here.

 

Please don't contain any Confidential Information or Real data in your reply.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

parry2k
Super User
Super User

@AlakarHarijan1 so I guess you have paid and unpaid, for each row, one column is blank with no value  or it is a zero value?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi Parry,

 

Thanks for reply, i have figured out a way to get it solved. using below code.

 

Table = SUMMARIZE(Sheet1,Sheet1[Region],"Paid Calls",COUNTX(FILTER(Sheet1,Sheet1[Stakeholder Code]="UNIV"&&Sheet1[Paid Count]="Paid"),Sheet1[Paid Count])," Not Paid Calls",COUNTX(FILTER(Sheet1,Sheet1[Stakeholder Code]="UNIV"&&Sheet1[Paid Count]="Not Paid"),Sheet1[Paid Count]),"Total",COUNTX(FILTER(Sheet1,Sheet1[Stakeholder Code]="UNIV"),Sheet1[Paid Count]))

 

but now facing difficulty in some thing else.

 

Now I want to get the sum of revenue using below code.

 

Table = SUMMARIZE(Sheet1,Sheet1[Region],"Paid Calls",COUNTX(FILTER(Sheet1,Sheet1[Stakeholder Code]="UNIV"&&Sheet1[Paid Count]="Paid"),Sheet1[Paid Count])," Not Paid Calls",COUNTX(FILTER(Sheet1,Sheet1[Stakeholder Code]="UNIV"&&Sheet1[Paid Count]="Not Paid"),Sheet1[Paid Count]),"Total",COUNTX(FILTER(Sheet1,Sheet1[Stakeholder Code]="UNIV"),Sheet1[Paid Count])," Revenue Received ",SUMX(FILTER(Sheet1,Sheet1[Stakeholder Code]="UNIV"&&Sheet1[Paid Count]="Paid"),Sheet1[Paid Count]))

 

But its giving error.

 

Can you please help me with it.

 

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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