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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

How to change table visual data

Hi, I need help in transforming below table visual into a different format.

 

Currently, this is how it looks like.

burrito_0-1701750485074.png

 

I want to transform it into below format.

burrito_1-1701750509888.png

 

So instead of a row for each vendor, I want to make it to number of vendors for that group.

 

I already tried to use distinctcount DAX but when I use a filter, it will only cover the top expense and not the expenses within the specified range.

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User

8 REPLIES 8
v-xinruzhu-msft
Community Support
Community Support

Hi @Anonymous 

You can create the following measures

Sum_Expense = CALCULATE(SUM('Table'[Expense]),ALLSELECTED('Table'),'Table'[Group] in VALUES('Table'[Group]))
Sum_%Expense = CALCULATE(SUM('Table'[%Expense]),ALLSELECTED('Table'),'Table'[Group] in VALUES('Table'[Group]))
Sum_Rute = CALCULATE(SUM('Table'[Routes]),ALLSELECTED('Table'),'Table'[Group] in VALUES('Table'[Group]))
Sum_%Rute = CALCULATE(SUM('Table'[%Route]),ALLSELECTED('Table'),'Table'[Group] in VALUES('Table'[Group]))
Count_Vendor = CALCULATE(DISTINCTCOUNT('Table'[Vendor]),ALLSELECTED('Table'),'Table'[Group] in VALUES('Table'[Group]))

vxinruzhumsft_0-1702023502137.png

Best Regards!

Yolo Zhu

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

Ahmedx
Super User
Super User

pls try this

Screenshot_1.png

Anonymous
Not applicable

I cannot download the file.

VahidDM
Super User
Super User

Hi @Anonymous 

 

Try use this:

#Vendor =
COUNTROWS ( VALUES ( 'Table'[Vendor] ) )

 

Output:

VahidDM_0-1701751391987.png

 

 

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

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

Anonymous
Not applicable

I tried this however when I choose a value from the slicer, the data that comes out is inaccurate. It will only show the top group and not all groups and vendor count for each.

Can you share some information about that slicer? what column has been used in that slicer? any info re the data model?

 

Cheers,

Vahid

danextian
Super User
Super User

Hi @Anonymous ,

 

While the table visual is active, change the summarization for Vendor column.

danextian_0-1701751082297.png

Alternatively, you can create a measure that counts the number of rows in a table and use that in your table instead  of vendor column

row count =
COUNTROWS ( data[vendor] )

 

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Anonymous
Not applicable

I actually did this however when I choose a value from the slicer, the data that comes out is inaccurate. It will only show the top group and not all groups and vendor count for each.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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