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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
polimoda
Regular Visitor

Filters with 2 or more column

I'm new on PowerBI and I'm trying to undestand better how to use DAX.

I have the following table named say "Opportunity"

Id      Stage

1       0

2       1

3       0

4       2

5       0

6       1

7       1

8       0

9       1

10     2  

11     2

 

What I would like to obtain is a new table where for each distint value of Stage I have the count of row that are lower or equal to that value. In other words, I would like to obtain a table named "pipeline" with two colums like:

Col1=Distinct(Opportunity[Stage])

Col2=COUNTROWS ( filter(Opportunity; Opportunity[Stage] >= Col1 )

 

obtaing as a final result

Col1       Col2

0              11

1              7

2              3

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

@polimoda

All you really need is this MEASURE

Measure =
CALCULATE (
    COUNTA ( Opportunity[Stage] ),
    FILTER (
        ALLSELECTED ( Opportunity ),
        Opportunity[Stage] >= MIN ( Opportunity[Stage] )
    )
)

Then create a Table Visualization like in the picture...

Filters with 2 or more column.png

Hope this helps.

Good Luck! Smiley Happy

 

View solution in original post

2 REPLIES 2
Sean
Community Champion
Community Champion

@polimoda

All you really need is this MEASURE

Measure =
CALCULATE (
    COUNTA ( Opportunity[Stage] ),
    FILTER (
        ALLSELECTED ( Opportunity ),
        Opportunity[Stage] >= MIN ( Opportunity[Stage] )
    )
)

Then create a Table Visualization like in the picture...

Filters with 2 or more column.png

Hope this helps.

Good Luck! Smiley Happy

 

Thanks @Sean, after adapting it to my real data, the proposed solution seems to be working!

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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