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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Syndicate_Admin
Administrator
Administrator

Porcentajes agregados de fin de mes

Digamos que tengo la siguiente tabla:

Medida A Medida B Mes

5 10 Ene

3 30 Ene

6 10 feb

3 5 feb

40 50 mar

Lo que tengo que hacer a través de DAX es esto:

Obtenga (A / B) % para cada mes: así que enero es (8/40) * 100%, febrero es (9/15) * 100% y marzo es 40/50 * 100%

Una vez que obtengo jan como 20%, febrero como 60% y marzo como 80% necesito promediar estos tres valores --> (20+60+80)/3 = 53.33

¿Cómo puedo hacer esto en dax?

1 REPLY 1
Syndicate_Admin
Administrator
Administrator

Hola

Supongo que la medida A y la medida B son columnas.

Por favor, compruebe la imagen de abajo y el archivo pbix adjunto.

Untitled.png

Expected result measure: =
VAR _newtable =
    ADDCOLUMNS (
        VALUES ( Data[Month] ),
        "@sumcolumnA", CALCULATE ( SUM ( Data[Measure A] ) ),
        "@sumcolumnB", CALCULATE ( SUM ( Data[Measure B] ) )
    )
RETURN
    AVERAGEX ( _newtable, [@sumcolumnA] / [@sumcolumnB] ) * 100

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Solution Authors