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