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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
nckpedersen
Helper I
Helper I

If SelectedValue has a positive value in both columns within matrix

Need some help on grid calculations. Given the matrix below, how can I retrieve values that have a positive count in both 2022 and 2023 (Crowdstrike both DEN and DGN = 1, Crowe DGN = 1, ICA = 0, Data Storage DGN = 0):

nckpedersen_0-1690312956179.png

Sample data below. 

IdNameGroupDate
abc123Data Storage CorporationDGN2022
abc124Dajani Consulting Inc.ICA2023
abc125Dajani Consulting Inc.ICA2022
abc126Datadog IncICA2023
abc127Crowe LLPICA2022
abc128CrowdStrike IncDEN2022
abc129CrowdStrike IncDEN2023
abc130Crown Castle International Corp.DEN2023
abc131Crown Castle International Corp.DEN2022
abc132Crown Castle International Corp.DGN2023
abc133Crown Castle International Corp.DGN2022
abc134Datadog IncDGN2022
abc135Data.WorldDGN2022
abc136CrowdStrike IncDGN2022
abc137CrowdStrike IncDGN2023
abc138Crowe LLPDGN2023
abc139Crowe LLPDGN2022

 

1 ACCEPTED SOLUTION
nckpedersen
Helper I
Helper I

Found the answer using variables:

21/22 YoY =
    var count_2021 = calculate(count('Purchases'[Id]),year('Purchases'[CloseDate])=2021)
    var count_2022 = calculate(count('Purchases'[Id]),year('Purchases'[CloseDate])=2022)
return
    if(count_2021 > 0 && count_2022 > 0, 1, 0)

View solution in original post

1 REPLY 1
nckpedersen
Helper I
Helper I

Found the answer using variables:

21/22 YoY =
    var count_2021 = calculate(count('Purchases'[Id]),year('Purchases'[CloseDate])=2021)
    var count_2022 = calculate(count('Purchases'[Id]),year('Purchases'[CloseDate])=2022)
return
    if(count_2021 > 0 && count_2022 > 0, 1, 0)

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.