cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SophRow
Advocate I
Advocate I

Create new summary table

Hi,

 

I have a table of sites and various metrics, and I created a calculated column to define 'Query age'

 

SophRow_0-1669242944452.png

What I need is a new table that summarise query age > 1 months for each site, i.e.,

SophRow_1-1669243123109.png

Not sure how to do this as Query age is a calculated column!

 

Thanks,

Soph

1 ACCEPTED SOLUTION
FreemanZ
Community Champion
Community Champion

try to create a new table with the code below:

Table =
ADDCOLUMNS(
    VALUES(TableName[Site]),
    ">1 month",
   CALCULATE(
        COUNTROWS(
            FILTER(
                TableName,
                TableName[Query age] <>"<1 month"
            )
        )
    )  
)
 
I tried and it works like this:
FreemanZ_0-1669254910937.png

 

View solution in original post

8 REPLIES 8
Ashish_Mathur
Super User
Super User

Hi,

to your Table visual, drag Site and this measure

Measure1 = calculate(countrows(Data),Data[Query Age]<>"<1 month")

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
FreemanZ
Community Champion
Community Champion

try to create a new table with the code below:

Table =
ADDCOLUMNS(
    VALUES(TableName[Site]),
    ">1 month",
   CALCULATE(
        COUNTROWS(
            FILTER(
                TableName,
                TableName[Query age] <>"<1 month"
            )
        )
    )  
)
 
I tried and it works like this:
FreemanZ_0-1669254910937.png

 

Brilliant - thank you 🙂

 

FreemanZ
Community Champion
Community Champion

@SophRow  You are welcome. Is it qualified as a solution to your question?

djurecicK2
Memorable Member
Memorable Member

@SophRow 

Something like this- modify to fit your table and field names.

 

CountMeasure= CALCULATE(COUNT(Tablename[Query age]), FILTER(Tablename, Tablename[New Calculated Column]= TRUE))

 

Please consider accepting as solution if this has answered the question.


If this post helps, then please consider accepting it as the solution to help other members find it more quickly.
djurecicK2
Memorable Member
Memorable Member

Hi @SophRow ,

 You could create another calculated colum that is true or false depending on if the query age is > 1 month. Then use that column to filter your count.


If this post helps, then please consider accepting it as the solution to help other members find it more quickly.

Thanks! I've created that column - can you share the DAX for the count?

(basically how i get to the second excel example in my first post)

 

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.