cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

Helper I

## Need Help with measure

Hi guys, i have a table wiht this columns:

 Fecha Atrasos2 Atrasos3 Capital_MN 30/9/2018 5 5 478 31/10/2019 40 40 9821 30/11/2019 56 56 8425 31/12/2019 87 87 478 31/1/2020 10 0 1000 28/2/2020 50 0 2000 31/3/2020 1 0 50 28/4/2020 12 0 700 31/10/2020 2 0 800 30/11/2020 1 0 1550 31/1/2021 10 0 1205 28/2/2021 600 600 200 30/4/2021 20 20 355

Atrasos2: They are the days behind without taking into account the covid issue.

Atrasos3: It is a calculated column where if the dates are between 31/01/2020 and 31/01/2021 (covid issue), the days of arrears are zeroed.

I also have this measure:

SUMAPRODUCTO CARTERA = SUMX(VW_Cartera,VW_Cartera[Atrasos2]*VW_Cartera[Capital_MN])/SUM(VW_Cartera[Capital_MN])

I want to create this filter:

And even I need the measure to calculate with the column "Atrasos2" when I select "Normal" or do not select anything, and to calculate with the column "Atrasos3" when I select "Covid".

How should i do it?

Thanks

1 ACCEPTED SOLUTION
Super User

@ArquimedesP

Use the measure given below:

``````SUMAPRODUCTO CARTERA =
VAR __V =
SELECTEDVALUE ( Table[VAlue], "Normal" )
RETURN
DIVIDE (
SUMX (
VW_Cartera,
IF (
__v = "Covid",
VW_Cartera[Atrasos3] * VW_Cartera[Capital_MN],
VW_Cartera[Atrasos2] * VW_Cartera[Capital_MN]
)
),
SUM ( VW_Cartera[Capital_MN] )
)``````

Did I answer your question? Mark my post as a solution! and hit thumbs up
2 REPLIES 2
Helper I

it worked perfectly! Thanks a lot!

Super User

@ArquimedesP

Use the measure given below:

``````SUMAPRODUCTO CARTERA =
VAR __V =
SELECTEDVALUE ( Table[VAlue], "Normal" )
RETURN
DIVIDE (
SUMX (
VW_Cartera,
IF (
__v = "Covid",
VW_Cartera[Atrasos3] * VW_Cartera[Capital_MN],
VW_Cartera[Atrasos2] * VW_Cartera[Capital_MN]
)
),
SUM ( VW_Cartera[Capital_MN] )
)``````

Did I answer your question? Mark my post as a solution! and hit thumbs up

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors