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

Create a total table from an other table

Hi,

 

I have a data table like this : 

Data.png

 

I want to create a new table with the total (direct + toller) for each year (2021 and 2022)

And the percentage of direct (direct value / direct value + toller value)

The table I need is this : 

table.png

If someone can help me, thanks in advance !

1 ACCEPTED SOLUTION
vivran22
Community Champion
Community Champion

Hello @Anonymous 

 

I have used the following sample data:

 

vivran22_2-1633689945880.png

 

And created following measures:

 

Total Value = SUM('Table'[Value])
 
% Cat A =
VAR _CatA = CALCULATE([Total Value],'Table'[Category] = "CAT A")
VAR _Overall = CALCULATE([Total Value],REMOVEFILTERS('Table'[Category]))
RETURN
DIVIDE(_CatA,_Overall)
 
Result:
 
vivran22_3-1633689985960.png

 

Hope this helps

View solution in original post

2 REPLIES 2
PaulDBrown
Community Champion
Community Champion

Create the following measures for the matrix:

 

Sum Valeur = SUM(FactTable[Valeur])
% Drying Direct =
VAR Direct =
    CALCULATE (
        [Sum Valeur],
        FILTER ( FactTable, FactTable[Category] = "Drying Direct" )
    )
RETURN
    IF (
        ISINSCOPE ( FactTable[Country] ),
        BLANK (),
        DIVIDE ( Direct, [Sum Valeur] )
    )

 

Create the matrix with the Year in rows, the country in columns and add both measures. Then do the following:

HideCol.gif

 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






vivran22
Community Champion
Community Champion

Hello @Anonymous 

 

I have used the following sample data:

 

vivran22_2-1633689945880.png

 

And created following measures:

 

Total Value = SUM('Table'[Value])
 
% Cat A =
VAR _CatA = CALCULATE([Total Value],'Table'[Category] = "CAT A")
VAR _Overall = CALCULATE([Total Value],REMOVEFILTERS('Table'[Category]))
RETURN
DIVIDE(_CatA,_Overall)
 
Result:
 
vivran22_3-1633689985960.png

 

Hope this helps

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!