Forum Discussion
Dynamic dashboard , performance measuring parameter
Hi nn92 ,
I am not sure what desired result would you want, could you please share your sample data or desired output screenshots for further analysis? You can also upload sample pbix to OneDrive and post the link here. Do mask sensitive data before uploading.
Best Regards,
Amy
- nn927 years agoFrequent Visitor
Hi,
Thanks for replying.
My dataset has following format: 0.9 , 0.3 , 0.6 , 1.2 , 1.6 , 1.8 etc.
So number of minutes. Each row is one number. I just want to function in DAX that will be able to tell me the percentage of these nubmers that are smaller than 1. I tried today with COUNTA COUNTX and similar, but not succesfully.
it doesn't accept measure = countx TableName(CollumnName) > 1
somehow it seems that DAX doesnt work with >< operators.
- Cmcmahan7 years agoResident Rockstar
DAX does work with < and > operators. However the expression to determine what you're counting and the table you're counting on are separate. What you're trying to do is to count the number of times your expression (TableName[ColumnName] < 1) is TRUE(). For this, you want to use COUNTAX:
COUNTAX(FILTER(Table, Table[Column] < 1), Table[Column])
Now we need to get that as a percentage instead of just a count.
PercentMeasure = COUNTAX(FILTER(Table, Table[Column] < 1), Table[Column]) / COUNTA(Table[Column])
- nn927 years agoFrequent Visitor
Hi,
Thanks for the answer, almost there!
PercentMeasure = COUNTAX(FILTER(Table, Table[Column] < 1), Table[Column]) / COUNTA(Table[Column])
The problem is that your code returnes value 1.
I guess that DAX is filtering the table, counting the number of rows and then dividing it with the number of rows of filtered table (same number of rows).
Any info on this? I managed to find "quick and dirty" solution - introducing 3 measures -
Measure 1 = total number of rows
measurure 2 = number of rows that are less than 1
measure 3 = measure 2/measure 1
it works, but it is not the most estetic solution :D