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
admin11
Memorable Member
Memorable Member

It there any VIZ for display P&L summary table

Hi Card

 

I like to create a summary P&L Table :-

 

Rev ......... 100K

COGS........80K

PROFIT.....20K

EXP............10k

NP..............10k

 

I have try the 3 different type of card all not suitable :-

admin11_0-1612256503241.png

 

Paul

 

1 ACCEPTED SOLUTION

Hi, @admin11 

You can try the following steps.

 

1 Create a Calculated table

Table =

VAR t_cogs =

    FILTER ( DISTINCT ( GL[1_COGS] ), NOT ( ISBLANK ( GL[1_COGS] ) ) )

VAR t_exp =

    FILTER ( DISTINCT ( GL[1_EXP] ), NOT ( ISBLANK ( GL[1_EXP] ) ) )

VAR t_cogs_exp =

    UNION ( t_cogs, t_exp )

RETURN

    SELECTCOLUMNS ( t_cogs_exp, "COGS&EXP", [1_COGS] )

 

2 Create a Measure

_YTD COGS&EXP = IF(SELECTEDVALUE('Table'[COGS&EXP])="COGS",[_YTD COGS],[_YTD EXP]/1000)

 

3 Crate a Table visual, the result looks like this:

v-cazheng-msft_0-1612407276022.png

 

v-cazheng-msft_1-1612407276023.png

v-cazheng-msft_13-1612408287390.png

Best Regards,

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

17 REPLIES 17
v-cazheng-msft
Community Support
Community Support

Hi, @admin11 

In your formula, the name of Measures used don't match the Measures ‘_YTD_COGS’, ‘_YTD EXP’ and ‘_YTD COGS’ in your file. And there are some columns with yellow alert information. You need cope with them firstly, then you can try this Measure:

 

Table =

UNION (

    SUMMARIZE ( 'Date', "REV", [_LYTD REV] ),

    SUMMARIZE ( 'Date', "COGS", [_YTD COGS] ),

    SUMMARIZE ( 'Date', "Exp", [_YTD EXP] )

)

 

For more details about SUMMARIZE function, you can refer Power BI SUMMARIZE and All secrets of SUMMARIZE.

 

Best Regards,

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

aj1973
Community Champion
Community Champion

@admin11 

Add ROUNDDOWN to the formula

aj1973_0-1612408285469.png

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

I'm confused with the data '376,760' and '583,679'. Can you explain how to get them?

 

Best Regards 

Caiyun Zheng

@v-cazheng-msft 

The issue already solve. now working fine. that are the old post.

Thank you very much 

Paul

Hi, @admin11 

You can try the following steps.

 

1 Create a Calculated table

Table =

VAR t_cogs =

    FILTER ( DISTINCT ( GL[1_COGS] ), NOT ( ISBLANK ( GL[1_COGS] ) ) )

VAR t_exp =

    FILTER ( DISTINCT ( GL[1_EXP] ), NOT ( ISBLANK ( GL[1_EXP] ) ) )

VAR t_cogs_exp =

    UNION ( t_cogs, t_exp )

RETURN

    SELECTCOLUMNS ( t_cogs_exp, "COGS&EXP", [1_COGS] )

 

2 Create a Measure

_YTD COGS&EXP = IF(SELECTEDVALUE('Table'[COGS&EXP])="COGS",[_YTD COGS],[_YTD EXP]/1000)

 

3 Crate a Table visual, the result looks like this:

v-cazheng-msft_0-1612407276022.png

 

v-cazheng-msft_1-1612407276023.png

v-cazheng-msft_13-1612408287390.png

Best Regards,

Caiyun Zheng

 

Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-cazheng-msft 

i Try to add one more field _YTD_OTH

 

First i create below Table_ it work fine , no error  :-

Table_ =

VAR t_rev =

FILTER ( DISTINCT ( GL[1_REV] ), NOT ( ISBLANK ( GL[1_REV] ) ) )
 
VAR t_cogs =

FILTER ( DISTINCT ( GL[1_COGS] ), NOT ( ISBLANK ( GL[1_COGS] ) ) )
 
VAR t_oth =

FILTER ( DISTINCT ( GL[1_OTH] ), NOT ( ISBLANK ( GL[1_OTH] ) ) )

VAR t_rev_cogs_oth =

UNION ( t_rev, t_cogs, t_oth )

RETURN

SELECTCOLUMNS ( t_rev_cogs_oth, "REV&COGS&OTH", [1_REV] )
 

I dont get any error , until i try to create the measure :-

 

_YTD REV&COGS&OTH = IF(SELECTEDVALUE('Table_'[REV&COGS&OTH])="COGS",[_YTD COGS],[_YTD REV],[_YTD OTH])
 
Error code :-
Too many arguments were passed to the IF function. The maximum argument count for the function is 3.
 

admin11_0-1612411992704.png

my PBI file :-

https://www.dropbox.com/s/52ejc1n6x2y9uq3/PBT_V2021_170%20Create%20REV%20and%20COGS%20EXP%20P%26L%20...

 

Paul

You can try this Measure.

 

_YTD COGS&EXP&OTH =
SWITCH (
TRUE (),
'Table'[COGS&EXP&OTH] = "COGS", [_YTD COGS],
'Table'[COGS&EXP&OTH] = "EXP", [_YTD EXP],
'Table'[COGS&EXP&OTH] = "OTH", [_YTD OTH]
)

 

Best Regards,

Caiyun Zheng

It is caused by the table name error. In the formula, the table name is 'Table', but the table name in your pbix file is 'Table_'. Just change 'Table' to 'Table_'.

 

Best Regards

Caiyun Zheng

@v-cazheng-msft

i start a new track to solve the issue , hope you can participate as well :- 

https://community.powerbi.com/t5/Desktop/Problem-Statement-Create-P-amp-L-Summary-Table-for-GL-ANALY...

 

Paul

@v-cazheng-msft 

I have just try to change the table to table_ , still cannot.

By the way :-

Table for test with 2 field REV and COSG

Table_ for test with 3 field REV and COGS and OTH 

 

Can you refer the link above  , and try to help me make it work and share with me the working PBI file.

 

Thank 

 

Paul 

 

 

@v-cazheng-msft 

Thank you so much for your help , it work fine now.

Paul

 

aj1973
Community Champion
Community Champion

@admin11 

Act here

aj1973_0-1612405579611.png

 

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Hi AJ

Thank you for your help , i try but still not get waht i want :-

admin11_0-1612406118274.png

Paul

 

amitchandak
Super User
Super User

@admin11 , Not very clear, a new table like

 

union(
summarize('Table',"Var","Rev" ,[Rev] ),
summarize('Table',"Var","COGS" ,[COGS] ),
)

 

 

or a matrix visual with no row or column , with values and "Show on row"

https://www.burningsuit.co.uk/blog/2019/04/7-secrets-of-the-matrix-visual/

 

@amitchandak 

Thank you very much.  I try to union 3 table into 1 for below field name :-

admin11_1-1612262862742.png

 

I get error msg :-

 

admin11_0-1612262378041.png

 

https://www.dropbox.com/s/6r9z25lna28krzg/PBT%20GL%20VER0025%20how%20to%20create%20PNL%20summerise%2...

My PBI file :-

Paul

 

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.