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 all,
Here is a sample of my dataset, where:
- Job: one job can have multiple tasks, and be executed more than once in a day (job timestamp repeated).
- Task: multiple tasks happen within a job.
- Job TimeStamp: date and time the job started. One job can have multiple executions within a day.
- Job Date: date the job started.
- Job Status: can be either G or C.
- Unique Key: concatenation between Job and Job TimeStamp.
Here is a table I constructed using the following measures:
G = CALCULATE(DISTINCTCOUNTNOBLANK(Table1[Unique Key]),Table1[Job Status]="G")
Distinct Count Unique Key = DISTINCTCOUNTNOBLANK(Table1[Unique Key])
On the other hand, for those below average (Distinct Count Unique Key < Average):
This ranking should be filtered with a slicer by Job Date.
Ranking =
VAR SummaryTable =
FILTER(
SUMMARIZECOLUMNS(Table1[Job],Table1[Job Date],
"job_executions",DISTINCTCOUNTNOBLANK(Table1[Unique Key]),
"job_failed_aborted",CALCULATE(DISTINCTCOUNTNOBLANK(Table1[Unique Key]),Table1[Job Status]="G"),
"pcte_job_failed_aborted",CALCULATE(DISTINCTCOUNTNOBLANK(Table1[Unique Key]),Table1[Job Status]="G")/DISTINCTCOUNTNOBLANK(Table1[Unique Key])),
[job_failed_aborted]>0)
RETURN
RANKX(ALL(SummaryTable[job_name]),[pcte_job_failed_aborted],,DESC)
Hi @amitchandak ,
Thank you so much for your response; I tried to do as you mentioned, but got the following error:
Ranking =
VAR SummaryTable =
FILTER(
SUMMARIZE(Table1,Table1[Job],Table1[Job Date],
"job_executions",DISTINCTCOUNTNOBLANK(Table1[Unique Key]),
"job_failed_aborted",CALCULATE(DISTINCTCOUNTNOBLANK(Table1[Unique Key]),Table1[Job Status]="G"),
"pcte_job_failed_aborted",CALCULATE(DISTINCTCOUNTNOBLANK(Table1[Unique Key]),Table1[Job Status]="G")/DISTINCTCOUNTNOBLANK(Table1[Unique Key])),
[job_failed_aborted]>0)
RETURN
RANKX(SummaryTable,[pcte_job_failed_aborted],,DESC)
Error message: the value for 'pcte_job_failed_aborted' cannot be determined. Either the column doesn't exist, or there is no current row for this column.
@scaballerom , Create two measure like this and try
pcte_job_failed_aborted =Divide(CALCULATE(DISTINCTCOUNTNOBLANK(Table1[Unique Key]),Table1[Job Status]="G"),DISTINCTCOUNTNOBLANK(Table1[Unique Key]) )
Rank =
Rankx(
FILTER(
SUMMARIZE(allselected(Table1),Table1[Job],Table1[Job Date],
"job_executions",DISTINCTCOUNTNOBLANK(Table1[Unique Key]),
"job_failed_aborted",CALCULATE(DISTINCTCOUNTNOBLANK(Table1[Unique Key]),Table1[Job Status]="G")),
[job_failed_aborted]>0) , [pcte_job_failed_aborted] )
Hi @Amit,
That seems to work great (see image below).
However, how would you incorporate the condition about the comparison on the average?
When I incorporate more sample data (see image below):
And use condition:
Could you please help with this issue? If needed, I can provide both the Excel sample data amb PBI sample report.
Thanks so much.
Best,
S
@scaballerom , Use summarize and when you give a table name use all or allselected
example
summarize(allselected(Table1), <Other columns>)
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 |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |