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
PamLeek
Frequent Visitor

Adding a Filter affecting my tables returned values

Hi

 

I need help in that when I try to apply a BI filter it removes those items from the pivot table and then returns an infinity response.

 

PamLeek_0-1631091187651.png

PamLeek_3-1631091258352.png

 

VOS as a % of Income = SUM('Actual'[P&L Amount]) / CALCULATE(sum('Actual'[P&L Amount]),FILTER(ALLSELECTED('Chart of Accounts'),'Chart of Accounts'[Type] = "Income")) * -100

 

VOS as a % of Budget Income = SUM('Budget'[02-2022R]) / CALCULATE(sum('Budget'[02-2022R]),FILTER(ALLSELECTED('Chart of Accounts'),'Chart of Accounts'[Type] = "Income")) * -100

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @PamLeek ;

In your case, because your dax 's conditional is [Type]="Income" and use allselected(), however you only filter [Type]="Variable Opreating", so CALCULATE(sum('Actual'[P&L Amount]),FILTER(ALLSELECTED('Chart of Accounts'),'Chart of Accounts'[Type] = "Income")) * -100 return 0. Because these two conditions are in conflict.

so i think you could modify the measure :

VOS as a % of Budget Income =
SUM ( 'Budget'[02-2022R] )
    / CALCULATE (
        SUM ( 'Budget'[02-2022R] ),
        FILTER ( ALL ( 'Chart of Accounts' ), 'Chart of Accounts'[Type] = "Income" )
    ) * -100
VOS as a % of Income =
SUM ( 'Actual'[P&L Amount] )
    / CALCULATE (
        SUM ( 'Actual'[P&L Amount] ),
        FILTER ( ALL ( 'Chart of Accounts' ), 'Chart of Accounts'[Type] = "Income" )
    ) * -100

vyalanwumsft_0-1631496668756.png

Looking forword to your reply!

Best Regards,
Community Support Team_ Yalan Wu
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

3 REPLIES 3
v-yalanwu-msft
Community Support
Community Support

Hi, @PamLeek ;

In your case, because your dax 's conditional is [Type]="Income" and use allselected(), however you only filter [Type]="Variable Opreating", so CALCULATE(sum('Actual'[P&L Amount]),FILTER(ALLSELECTED('Chart of Accounts'),'Chart of Accounts'[Type] = "Income")) * -100 return 0. Because these two conditions are in conflict.

so i think you could modify the measure :

VOS as a % of Budget Income =
SUM ( 'Budget'[02-2022R] )
    / CALCULATE (
        SUM ( 'Budget'[02-2022R] ),
        FILTER ( ALL ( 'Chart of Accounts' ), 'Chart of Accounts'[Type] = "Income" )
    ) * -100
VOS as a % of Income =
SUM ( 'Actual'[P&L Amount] )
    / CALCULATE (
        SUM ( 'Actual'[P&L Amount] ),
        FILTER ( ALL ( 'Chart of Accounts' ), 'Chart of Accounts'[Type] = "Income" )
    ) * -100

vyalanwumsft_0-1631496668756.png

Looking forword to your reply!

Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

PamLeek
Frequent Visitor

Hi @amitchandak  That doesn't seem to work either. See below I have Income in the table and the percentage (using my old calculation) works

PamLeek_0-1631172088332.png

 

but when i remove the income from the table (filter it out) it dissappears

PamLeek_1-1631172116116.png

 

amitchandak
Super User
Super User

@PamLeek , example 1 or the two ways

 

VOS as a % of Income =
var _1 = SUM('Actual'[P&L Amount])
var _2 = CALCULATE(sum('Actual'[P&L Amount]),FILTER(ALLSELECTED('Chart of Accounts'),'Chart of Accounts'[Type] = "Income"))
return
divide(_1,_2)

 

or

 

VOS as a % of Income =
var _1 = SUM('Actual'[P&L Amount])
var _2 = CALCULATE(sum('Actual'[P&L Amount]),FILTER(ALLSELECTED('Chart of Accounts'),'Chart of Accounts'[Type] = "Income"))
return
if(isblank(_2) , divide(_1,_2) )

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.