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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
954571
Frequent Visitor

True False Statement Help

Hi there,

I am trying to find out if it is possible to create a measure /column / slicer/filter where it would essentially give me either one value or all values in Column X as a TRUE/FALSE function.

Where, say, Column X has posisble values A, B and C with  approx. 10K rows. 
I would like the TRUE/FALSE filter to show value A if TRUE is selected all values (AB and C) if FALSE is selected for the filter and only show value A if TRUE was selected.

Reference IDNumber AmountColumn X
1100A
2100A
3100B
4200B
5200A
6200C
7300B
8300A
9300A

 

 

Table above would be mock data. Where total of Number Amount is 1800. A total is 1000, B is 600 and C is 200.

I would then like to create a filter that would be TRUE or FALSE (or Yes/No). Where TRUE woud give me a total number value of 1000 (as it would be A only) and FALSE would give me value 1800 9as it would total A, B and C).

Is this possible in Power BI?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

Thanks for the solution PwerQueryKees  and Greg_Deckler  offered, and i want to offer some more information for user to refer to.

hello @954571 , you can refer to the following solution.

Sample data is the same as you provided, you can create a slicer table first.

vxinruzhumsft_0-1723168528968.png

Then create a measure

MEASURE =
IF (
    ISFILTERED ( Slicer[Selection] )
        && SELECTEDVALUE ( Slicer[Selection] ) = "Yes",
    CALCULATE ( SUM ( 'Table'[Number Amount] ), 'Table'[Column X] = "A" ),
    CALCULATE ( SUM ( 'Table'[Number Amount] ) )
)

Then put them to the visual.

Ouptut

vxinruzhumsft_1-1723168669633.png

 

vxinruzhumsft_2-1723168678690.png

Best Regards!

Yolo Zhu

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

6 REPLIES 6
PwerQueryKees
Super User
Super User

You posting this in the power query forum. I don't think power query would be the best for your problem, but correct me if I am wrong and I will be glad to help.

Okay thank you , I was unsure. I have editted question. Hopefully it is more clear now what I am trying to achieve.

Greg_Deckler
Community Champion
Community Champion

@954571 Sounds like a Complex Selector but hard to know without more information, sample data, etc. The Complex Selector - Microsoft Fabric Community

 

Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thank you for the response, I have editted the question, hopefully it is more clear what I am trying to achieve.

Anonymous
Not applicable

Hi,

Thanks for the solution PwerQueryKees  and Greg_Deckler  offered, and i want to offer some more information for user to refer to.

hello @954571 , you can refer to the following solution.

Sample data is the same as you provided, you can create a slicer table first.

vxinruzhumsft_0-1723168528968.png

Then create a measure

MEASURE =
IF (
    ISFILTERED ( Slicer[Selection] )
        && SELECTEDVALUE ( Slicer[Selection] ) = "Yes",
    CALCULATE ( SUM ( 'Table'[Number Amount] ), 'Table'[Column X] = "A" ),
    CALCULATE ( SUM ( 'Table'[Number Amount] ) )
)

Then put them to the visual.

Ouptut

vxinruzhumsft_1-1723168669633.png

 

vxinruzhumsft_2-1723168678690.png

Best Regards!

Yolo Zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Thank you this helped get what was needed.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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