Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

show values table

Forum home » Delegate support and help forum » Microsoft Power BI training and help » Show 2 values from a table without showing the same value twice

Show 2 values from a table without showing the same value twice

ResolvedVersion 365

Amy has attended:
Power BI Reporting course

Show 2 values from a table without showing the same value twice

I am looking to use a clustered bar chart to show new vs returning bookings for an event. Within the table, I have identified the users who have returned with 'Yes' and have found this within the filters section - but alongside the count of email addresses, I'm getting the same bar twice.

I'm after having the top bar as current bookings, and the one below as those returning.

How do I format this to get the 2 different values without showing the same value twice? I can also send a screenshot if this is helpful

RE: Show 2 values from a table without showing the same value tw

Hi Amy,

Thank you for the forum question.

Thanks for the detailed explanation! It sounds like you're trying to create a clustered bar chart in Power BI that compares new vs. returning bookings for an event, but you're seeing duplicate bars or the same value twice.
Here’s how you can structure your data and visuals to achieve your goal:
________________________________________

Step-by-Step Solution

1. Data Structure
Assume your table looks like this:
Email BookingID Returning
user1@email.com 001 Yes
user2@email.com 002 No
user3@email.com 003 Yes

2. Create a Measure for Each Group

You’ll need two measures to count bookings:
• New Bookings: NewBookings = CALCULATE(COUNT('Table'[Email]), 'Table'[Returning] = "No")

• Returning Bookings: ReturningBookings = CALCULATE(COUNT('Table'[Email]), 'Table'[Returning] = "Yes")


3. Create a Supporting Table for Axis
Create a new table (manually or with DAX) to use as the axis:
BookingType = DATATABLE("Type", STRING, {{"New"}, {"Returning"}})


4. Create a Combined Measure
Now create a measure that returns the correct value based on the

axis:
BookingCount =
SWITCH(
SELECTEDVALUE(BookingType[Type]),
"New", [NewBookings],
"Returning", [ReturningBookings]
)

5. Build the Chart
• Use BookingType[Type] as the Axis.
• Use BookingCount as the Values.
• This will show one bar for New and one for Returning, without duplication.




Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

RE: Show 2 values from a table without showing the same value tw

I've gotten stuck on step 3, I'm not sure how to do this. I've created the table, but all I have is the heading of 'Type' with NewBookings, and ReturningBookings as the values, I'm not sure how this is supposed to look?

RE: Show 2 values from a table without showing the same value tw

Hi Amy,

To create the table CLICK NEW TABLE in the CALCULATIONS group. In the formula bar type:

BookingType = DATATABLE("Type", STRING, {{"New"}, {"Returning"}})

If you do this and follow the steps, you will get what you need.


Kind regards

Jens Bonde
Microsoft Office Specialist Trainer

Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us

London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector

 

Training courses

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Power BI tip:

Navigation Shortcuts

Ctrl + Left Arrow/Right Arrow/Up Arrow/Down Arrow: Move selected object in the respective direction.
Ctrl + Shift + Left Arrow/Right Arrow/Up Arrow/Down Arrow: Resize selected object in the respective direction.
Ctrl + Shift + Up Arrow/Down Arrow: Bring forward or send backward the selected object in the report layer.

View all Power BI hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.