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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
joshl525
Frequent Visitor

Using two filters with a conditional

Hello, guys, 

 

I was trying to move from this measure =CALCULATE(SUM(BD_Core[Valor]),BD_Core[Versión]="Ppto V2")

to this: 

CALCULATE( SUM(BD_Core[Valor]), FILTER( BD_Core, ( BD_Core[year] = 2025 && BD_Core[Versión] = "Ppto V2" ) || ( BD_Core[year] <> 2025 && BD_Core[Versión] = "VP" ) ) )CALCULATE( SUM(BD_Core[Valor]), FILTER( BD_Core, ( BD_Core[year] = 2025 && BD_Core[Versión] = "Ppto V2" ) || ( BD_Core[year] <> 2025 && BD_Core[Versión] = "VP" ) ) )

 

in order to use a filter to sum values based on two filters: the first one being the year, and the second one the version or category. So if the year is 2025 it sums the values under "V2" category. Else, under "VP". However, it just displays blank rows. Any help on this?

 

 

Thanks in advance

1 ACCEPTED SOLUTION
joshl525
Frequent Visitor

Hello, I solved it using a SWITCH function:
=SWITCH(MAX(BD_Core[Year]),2025,CALCULATE(SUM(BD_Core[Valor]),BD_Core[Versión]="Ppto V2"),(CALCULATE( SUM(BD_Core[Valor]), BD_Core[Versión] = "VP" )))

 

View solution in original post

4 REPLIES 4
v-venuppu
Community Support
Community Support

Hi @joshl525 ,

Thank you for reaching out to Microsoft Fabric Community.

Thank you @Irwan for the prompt response.

Great to hear that it's got solved from your end.I would suggest accepting your approach as the solution so that it will be really helpful for others in the community who might be facing similar issues and can address them quickly.

joshl525
Frequent Visitor

Hello, I solved it using a SWITCH function:
=SWITCH(MAX(BD_Core[Year]),2025,CALCULATE(SUM(BD_Core[Valor]),BD_Core[Versión]="Ppto V2"),(CALCULATE( SUM(BD_Core[Valor]), BD_Core[Versión] = "VP" )))

 

joshl525
Frequent Visitor

Hello, Irwan, 

 

 

Thanks for your answer. The thing is that I'm not using visuals, just DAX, and queries in Excel, not in Power BI.

Irwan
Super User
Super User

hello @joshl525 

 

i dont know how your visual will be, but i think you can use filter or slicer to calculate sum when 2025 or/and under certain value to avoid more complex DAX.

Irwan_1-1759879557768.png

Irwan_2-1759879571484.png

 

Hope this will help.

Thank you.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.