The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Si selecciono en el segmentador de datos el año actual y el anterior simultaneamente me muestra este gráfico, los 2 años juntos, eso es lo que quiero, pero mi idea es seleccionar solo el 2024 y que me muestre el 2024 y el año anterior de la misma manera.
Solved! Go to Solution.
Hi,@migfar
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2.Generate a table containing only the year:
year Table = DISTINCT(SELECTCOLUMNS('SALE',"year",YEAR('SALE'[MOUTH])))
3. Below are the measure I've created for your needs:
Measure =
VAR select1=SELECTEDVALUE('year Table'[year])
RETURN CALCULATE(SUM('SALE'[VALUE]),FILTER(SALE,'SALE'[MOUTH].[Year]=select1||'SALE'[MOUTH].[Year]=select1-1))
4.Replaces the values in the visualization section with measure values:
5.Here's my final result, which I hope meets your requirements.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Si selecciono solo 2024 me sale así, y yo necesito el año anteior en el mismo gráfico..
Hi,@migfar
Regarding the issue you raised, my solution is as follows:
1.First I have created the following table and the column names and data are the data you have given:
2.Generate a table containing only the year:
year Table = DISTINCT(SELECTCOLUMNS('SALE',"year",YEAR('SALE'[MOUTH])))
3. Below are the measure I've created for your needs:
Measure =
VAR select1=SELECTEDVALUE('year Table'[year])
RETURN CALCULATE(SUM('SALE'[VALUE]),FILTER(SALE,'SALE'[MOUTH].[Year]=select1||'SALE'[MOUTH].[Year]=select1-1))
4.Replaces the values in the visualization section with measure values:
5.Here's my final result, which I hope meets your requirements.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
137 | |
106 | |
101 | |
74 | |
59 |
User | Count |
---|---|
260 | |
126 | |
115 | |
98 | |
87 |