Forum Discussion
IF column filtered then
- 8 years ago
Hi SebKaliVith
See the revised file here
I just changed selectedvalue to sum
Measure = IF ( COUNTROWS ( ALLSELECTED ( TableName[NAME] ) ) = COUNTROWS ( ALL ( TableName[NAME] ) ), SUM ( TableName[x] ), SUM ( TableName[y] ) )
Hi Zubair_Muhammad,
It Works great ! Thanks a lot !
But, i need to display this result in a "Stacked Bar Chart".
When i set "NAME" in AXIS and "Z" in Value, the "A" bar doesn"t appear.
Plus, when i filter with "B", the "B" bar doesn't appear too.
The A bar doesn't appear
When filtered, the B bar doesn't appear
I presume it is due to "SELECTEDVALUE" which can choose only one value, but A has two differents values.
Is there a formule which can fix it ?
Like a SUM of the values in X when filtered, and a SUM of the values in Y when isn't filtered.
(Sorry to ask again, i am Excel/VBA expert but a noob beginner on PBI ...)
In all cases, thanks for your help !
Regards,
Séb
Hi SebKaliVith
See the revised file here
I just changed selectedvalue to sum
Measure =
IF (
COUNTROWS ( ALLSELECTED ( TableName[NAME] ) )
= COUNTROWS ( ALL ( TableName[NAME] ) ),
SUM ( TableName[x] ),
SUM ( TableName[y] )
)- SebKaliVith8 years agoRegular Visitor
Thanks a lot for your help, i watched the file and it looks like exactly what i need.
I am going to try the measure you wrote on my real PowerBI report this afternoon.
I come back here if i have other questions.
Thanks a lot for the time you took to help beginners in the community !
Best,
SB