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,
I am trying to calculate employees with a positive Avg Daily Var % and I have a few ranges (From 0 to -10). I want to know how many people are on each range in a KPI, but my measure is working on a table not in the KPI. Can anybody please help me to fix this?
Sample since I have few measures,
https://drive.google.com/file/d/1fWYZNYuLrRSU81fAU2YGzuJA-VF3KiZL/view?usp=sharing
Formula -
Positive = COUNTROWS(FILTER(VALUES(Employee[firstlast]),Measures_Unit[Unit_Avg_Daily_Var._in_%] >0))
From 0 to -10% = COALESCE(
COUNTROWS(
FILTER(
VALUES(Employee[firstlast]),
(Measures_Unit[Unit_Avg_Daily_Var._in_%] <0.01 && Measures_Unit[Unit_Avg_Daily_Var._in_%] >= -0.1)
)),0)
Data-
Thank you so much
Solved! Go to Solution.
Hi @bikelley ,
According to my understand, you want to count distinct values when [measure]>0 , right?
You could use DISTINCTCOUNT() or DISTINCTCOUNTNOBLANK() functions to calculate.
po =
CALCULATE (
DISTINCTCOUNT ( Employee[firstlast] ),
FILTER ( 'Employee', [Unit_Avg_Daily_Var._in_%] > 0 )
)
from =
CALCULATE (
DISTINCTCOUNT ( 'Employee'[firstlast] ),
FILTER (
'Employee',
Measures_Unit[Unit_Avg_Daily_Var._in_%] < 0.01
&& Measures_Unit[Unit_Avg_Daily_Var._in_%] >= -0.1
)
)
My final output looks like this:
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin
Hi @bikelley ,
Could you tell me if your problem has been solved? If it is, kindly Accept it as the solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Eyelyn Qin
Hi @bikelley ,
According to my understand, you want to count distinct values when [measure]>0 , right?
You could use DISTINCTCOUNT() or DISTINCTCOUNTNOBLANK() functions to calculate.
po =
CALCULATE (
DISTINCTCOUNT ( Employee[firstlast] ),
FILTER ( 'Employee', [Unit_Avg_Daily_Var._in_%] > 0 )
)
from =
CALCULATE (
DISTINCTCOUNT ( 'Employee'[firstlast] ),
FILTER (
'Employee',
Measures_Unit[Unit_Avg_Daily_Var._in_%] < 0.01
&& Measures_Unit[Unit_Avg_Daily_Var._in_%] >= -0.1
)
)
My final output looks like this:
Did I answer your question ? Please mark my reply as solution. Thank you very much.
If not, please upload some insensitive data samples and expected output.
Best Regards,
Eyelyn Qin
@bikelley , Seem fine at first look. Try like
From 0 to -10% =countx(VALUES(Employee[firstlast]) ,(Measures_Unit[Unit_Avg_Daily_Var._in_%] <0.01 && Measures_Unit[Unit_Avg_Daily_Var._in_%] >= -0.1))+0
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |