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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
arturobl
Frequent Visitor

Visualize sales by dinamic age of product

So the thing is Id like to visualize the sales by year sorted by age of product in a dinamic context. This are the tables involved in this visual need. Captura de pantalla 2023-11-21 173321.png

I have this table 'Facturas' a fact table with the sales data('Facturas'[venta]) linked to Articulos.

Facturas[CodArticulo]--Articulos[codArticulo]

On the other hand i have the table SERIES with the date of the article serie "birth" (fecha_alta)

'SERIES'[descripcion]---Articulos[SERIE]. Obviously im working with a Calendar table called Calendario wich is linked to Facturas

So i want to know if im selecting 2020, the sales of the products with age 3, 4 ,5 or 6 in 2020 not those who has 3,4,5 years old now. I do have a measure that calculates the dinamic age by products but i cant make the analysis i want.

DiferenciaAños =
VAR a =
    YEAR ( TODAY () ) - YEAR ( SELECTEDVALUE ( 'SERIES'[fecha_alta] ) )
RETURN
    IF (
        ISFILTERED ( CALENDARIO[AÑO] ),
        a
            - ( YEAR ( TODAY () ) - SELECTEDVALUE ( CALENDARIO[AÑO] ) ),
        a
    )

1 REPLY 1
lbendlin
Super User
Super User

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...

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors