Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
I'm trying to extract the KPI of Quality service. To extrat the % i need to count the total orders for the last day in the dataset and count the incidents for the last day too. The question is, I don't know how to count dependig to date in a measure.
To have the last day in the dataset doing a MAX of the date is enought but I don't know how to implement that in a measure to have this condition.
Thanks in advance
Solved! Go to Solution.
@Anonymous
Maybe this formula is better:
Incidenciasultimodia = VAR _Maxdate = MAX ( 'Dataset'[Transformed DATA] ) RETURN CALCULATE ( COUNT ( 'Dataset'[TIPO] );FILTER('Dataset'; 'Dataset'[Transformed DATA] = _Maxdate || LEFT( 'Dataset'[TIPO], 2) = "AB" ))
Hi @Anonymous,
Could you please mark the proper answers as solutions?
Best Regards,
@Anonymous
You can try the following measure:
Measure = VAR _Maxdate = MAX ( 'Table'[Reference_Date] ) RETURN CALCULATE ( COUNT ( 'Table'[Order_ID] ), 'Table'[Reference_Date] = _Maxdate )
Thanks for your help it helps a lot 🙂
Related to that is it possible to add more conditions? for example now, i have the condition of the date but i want to add for example other like. Count if other column starts with AN por example.
Incidenciasultimodia = VAR _Maxdate = MAX ( 'Dataset'[Transformed DATA] ) RETURN CALCULATE ( COUNT ( 'Dataset'[TIPO] );FILTER('Dataset'; 'Dataset'[Transformed DATA] = _Maxdate || 'Dataset'[TIPO] = "AN%" ))
Now looks like this but is not working or showing an error
@Anonymous
No problem at all.
You can add other conditions as well.
I think the percenrage symbol is causing the error.
Change the formula to this one:
Incidenciasultimodia = VAR _Maxdate = MAX ( 'Dataset'[Transformed DATA] ) RETURN CALCULATE ( COUNT ( 'Dataset'[TIPO] );FILTER('Dataset'; 'Dataset'[Transformed DATA] = _Maxdate || SEARCH("AN", 'Dataset'[TIPO],,0) <> 0 ))
@Anonymous
Maybe this formula is better:
Incidenciasultimodia = VAR _Maxdate = MAX ( 'Dataset'[Transformed DATA] ) RETURN CALCULATE ( COUNT ( 'Dataset'[TIPO] );FILTER('Dataset'; 'Dataset'[Transformed DATA] = _Maxdate || LEFT( 'Dataset'[TIPO], 2) = "AB" ))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |