This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hello!
I have to plot a bar chart with a segmentation which depends on a date slicer.
Use case
Data columns:
user := the user name
step_id := the step id (the total of steps is 5 and it had to be through in order from 1 to 5)
date := the date when the step was finished
Given a date slicer, a bar chart with the following characteristics has to be plotted:
- The X-axis represents the 5 steps that users have to go through (in order)
- The Y-axis represents the total of users in each step for the selected dates
- The segmentation in each bar, has to show which of these step is the first of the user for the selected dates
Example
| user | step_id | date |
| Daniel | 1 | 01/01/2023 |
| Daniel | 2 | 02/01/2023 |
| Laura | 1 | 02/01/2023 |
| Laura | 2 | 03/01/2023 |
If date slicer is ( 01/01/2023 - 02/01/2023 )
Step_1
# First steps = 2 (the step 1 is the first for both users in date range)
# Not first steps = 0
Step_2
# First steps = 0
# Not first steps = 1 (the step 2 is Daniel's second step in date range) - Laura's step 2 is out of the date range
If date slicer is ( 02/01/2023 - 03/01/2023 )
Step_1
# First steps = 1 (the step 1 is Laura's first step in date range) - Daniel's step 1 is out of range
# Not first steps = 0
Step_2
# First steps = 1 (the step 2 is Daniel's first step in date range)
# Not first steps = 1 (the step 2 is Laura's second step in date range)
Problem
I have created the measure that calculates if each step is the first or not in the date range for each user, but I cannot use this measure in a bar chart as the legend in order to make the segmentation.
Any idea how can I do it?
At the end I attach some photos of my report and data as I am not able to publish the .pbix (sorry but I am new here in forum 😅)
-------------------------------------------------------------------------------------------------
Hola!
Tengo que representar un gráfico de barras con una segmentación de datos basada en un filtro de fechas
Caso de uso
Columnas:
user := nombre del usuario
step_id := el id del paso (el total de pasos es 5 y los usuarios los tienen que ir recorriendolos en orden del 1 al 5)
date := la fecha cuando se cumple cada paso
Dado un filtro/segmentación de fechas, se tiene que representar una gráfica de barras con las siguientes características:
- Eje X: representa los 5 pasos por los que tienen que pasar los usuarios (en orden)
- Eje Y: representa el total de usuarios en cada paso para las fechas seleccionadas
- La segmentación en cada barra tiene que mostrar cuántos de esos pasos son el primero de un usuario en las fechas seleccionadas.
Ejemplo
| user | step_id | date |
| Daniel | 1 | 01/01/2023 |
| Daniel | 2 | 02/01/2023 |
| Laura | 1 | 02/01/2023 |
| Laura | 2 | 03/01/2023 |
Si el filtro de fechas es ( 01/01/2023 - 02/01/2023 )
Paso_1
# Primeros pasos = 2 (el paso 1 es el primero para ambos usuarios en el rango de fechas)
# No primeros pasos = 0
Paso_2
# Primeros pasos = 0
# No primeros pasos = 1 (el paso 2 es el segundo paso de Daniel en el rango de fechas) - El paso 2 de Laura está fuera del rango de fechas
Si el filtro de fechas es ( 02/01/2023 - 03/01/2023 )
Paso_1
# Primeros pasos = 1 (el paso 1 es el primer paso de Laura en el rango de fechas) - El paso 1 de Daniel está fuera del rango
# No primeros pasos = 0
Paso_2
# Primeros pasos = 1 (el paso 2 es el primer paso de Daniel en el rango de fechas)
# No primeros pasos = 1 (el paso 2 es el segundo paso de Laura en el rango de fechas)
Problema
He creado la medida que calcula si cada paso es el primero o no en el rango de fechas para cada usuario, pero no puedo utilizar esta medida en un gráfico de barras como leyenda para poder hacer la segmentación.
¿Alguna idea de cómo puedo hacerlo?
Adjunto varias fotos con un ejemplo más completo y los problemas que he encontrado
(lo siento pero soy nueva en el foro y no consigo publicar el fichero .pbix 😅)
-----------------------------------------------------------------------------------------------
- Source data / Datos de origen
- Filtered data with the measure shown in a table / Datos filtrados con la medida incluida mostrados en tabla
- Expected result / Resultado esperado
- Problem with default "Stacked column chart" / Problema con la visualización predeterminada de "Gráfico de barras apiladas"
- Problem with other market visualization / Problema con otra visualización
- Measures / Medidas:
MinStep =
CALCULATE(
MIN( funnel_data[step_id] ),
FILTER(
ALLSELECTED(funnel_data) ,
COUNTROWS( FILTER( funnel_data, EARLIER( funnel_data[step_id] ) <= funnel_data[step_id] && EARLIER( funnel_data[user] ) == funnel_data[user] ) )
)
)
isFirstStep = CALCULATE(if(SELECTEDVALUE(funnel_data[step_id]) = [MinStep], "First", "NotFirst"))
Thank you! / ¡Gracias!
Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
If you are unsure how to do that please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
If you want to get answers faster please refer to https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 35 | |
| 27 | |
| 26 | |
| 22 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 36 | |
| 32 | |
| 26 | |
| 23 |