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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
admin11
Memorable Member
Memorable Member

How to interpreted expression for PnL_Table ?

Hi All

 

I have 2 P&L report working fine.

Try to combine 2 P&L report into 1.

After combine both of them into 1 , I get error.

 

admin11_0-1614997184616.png

Now i need to understand what is below code doing :-

_PNL_Table_S =

VAR t_rev =

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

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

VAR t_oth =

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

VAR t_exp =

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

VAR t_rev_cogs =

UNION ( t_rev, t_cogs, t_oth, t_exp )

VAR tbl = {(t_rev, 1), (t_cogs, 2), (t_oth, 3) , (t_exp, 4)}

RETURN

tbl
 
Hope some one can share with me.
 
Enclosed my PBI file which no error , Because when i remove all the data , the error dis-appear.
 
Paul Yeo
 

 

 

1 ACCEPTED SOLUTION

@admin11 

Remove the FILTER expression. It's not needed





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.






View solution in original post

4 REPLIES 4
PaulDBrown
Community Champion
Community Champion

It's difficult to see where the issue is. However, JFYI, You don't need to filter DISTINCT by no blanks; DISTINCT returns a table of unique values excluding blanks..





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.






@PaulDBrown 

Thank you for sharing.

 

Below is my orginal syntax :-

_PNL_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_exp =
FILTER ( DISTINCT ( GL[1_EXP] ), NOT ( ISBLANK ( GL[1_EXP] ) ) )
VAR t_rev_cogs =
UNION ( t_rev, t_cogs, t_oth, t_exp )
VAR tbl = {(t_rev, 1), (t_cogs, 2), (t_oth, 3) , (t_exp, 4)}
RETURN
tbl

 

Below syntax is where i remove filter Blank :-
_PNL_Table =
VAR t_rev =
FILTER ( DISTINCT ( GL[1_REV] ))
VAR t_cogs =
FILTER ( DISTINCT ( GL[1_COGS] ))
VAR t_oth =
FILTER ( DISTINCT ( GL[1_OTH] ))
VAR t_exp =
FILTER ( DISTINCT ( GL[1_EXP] ))
VAR t_rev_cogs =
UNION ( t_rev, t_cogs, t_oth, t_exp )
VAR tbl = {(t_rev, 1), (t_cogs, 2), (t_oth, 3) , (t_exp, 4)}
RETURN
tbl

 

I get error msg :-

 

admin11_0-1615116273695.png

 

My PBI file :-

https://www.dropbox.com/s/jt7drogywitrrg5/PBS%20GL%20ASK%20HOW%20TO%20REMOVE%20BLANK_.pbix?dl=0

 

Paul

@admin11 

Remove the FILTER expression. It's not needed





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.






@PaulDBrown 

Thank you it work fine now.

Paul

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors