March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi there
I can't seem to get this to work - hoping you can help!
I have the following columns in a large table extracted from print logs:
DateGenerated Time Hour Environment
1.2.2016 10:14 10 LEGACY
1.2.2016 11:15 11 NEW
The columns have much more information, but essentially I just want to count the number of times "LEGACY" & "NEW" appear on a certain date. Ideally, I would also be able to count date & hour - but I don't want to be greedy!
This is all to produce a % of total for each day.
Hope you can help! Thanks
Solved! Go to Solution.
Here's the example I created
The result looks like this
Here are the Measures I used
LEGACY # = COUNTROWS(FILTER(Table1, Table1[Environment]="LEGACY")) LEGACY % = DIVIDE([LEGACY #], [TOTAL #], 0) NEW # = COUNTROWS(FILTER(Table1, Table1[Environment]="NEW")) NEW % = DIVIDE([NEW #],[TOTAL #],0) TOTAL # = [LEGACY #] + [NEW #]
Hope this helps!
Hello everyone,
I'm a bit confused here.
Doesn't the below calculated measure give the same results regardless of how many environment types you have? That way if you have more than two environments, the percentage will be calculated using only one query rather than one or two for each type.
Environment % =
DIVIDE(COUNTROWS(Table) ,
CALCULATE(
COUNTROWS(Table),
ALL(Table[Environment])
))
You then create a matrix where you put your date as rows, environment as columns, environment summarized as count and the calculated environment % as values.
Does it also work?
Here's the example I created
The result looks like this
Here are the Measures I used
LEGACY # = COUNTROWS(FILTER(Table1, Table1[Environment]="LEGACY")) LEGACY % = DIVIDE([LEGACY #], [TOTAL #], 0) NEW # = COUNTROWS(FILTER(Table1, Table1[Environment]="NEW")) NEW % = DIVIDE([NEW #],[TOTAL #],0) TOTAL # = [LEGACY #] + [NEW #]
Hope this helps!
That's great Sean - thanks so much!
Quick question - just wondering if you manually created the entries in the 'DateGenerated' & 'Hour' columns, or were these automatically populated?
Thanks
Bryan
@bryan_d DateGenerated and Time yes manually I just created a small table to show you the result - Hour derived from time
Anyway the problem with the above formula suggested although it works in a Matrix - it has more limited use
How are you going to display just the Legacy # with a Card? (not multi-row card)
Can you create a Line and Clusted Column Chart?
Sorry, yes distinct count only works if you have a unique row identifer. Your countrows formula are the best for your data.
Hi @bryan_d,
you can use the COUNTA() function.
I'm sorry @MattAllington I tried with the DISTINCTCOUNT() function, but I simply got 2 referred to the two different environments (as you can see from the screenshot).
Let Me Know If It Works.
#I'M Not An Expert#
Put dateGenerated in rows in a matrix (or on a chart axis or what ever). Then write
=DISTINCTCOUNT(yourTableName[Environment])
same applies for the others
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |