Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

display count from measure

Hello, 

 

I create measure  to return specific text from condition 

 

 

 

Performance = 
var runpercent =
    [work day]/([COUNTDAY]
    )
var totalmile = 
    SUM('Distance'[Distance]
    )
var target =
    1300*[work day]/[COUNTDAY]
return

SWITCH(
    TRUE(),
     runpercent < 0.6, "VOR",
     totalmile <= target, "LOW DISTANCE",
     runpercent >= 0.6 && totalmile > target, "ON PERFORMANCE",
    BLANK()
)

 

 

 

I put the measure into table the result as follow  but i would like to count number of each "VOR" "LOW DISTANCE" and "ON PERFORMANCE"    and display on the card    please suggest me how to do it.

JJ8098_0-1692768440338.png

 

below is my data table:

JJ8098_0-1692769602390.png

 

 

thank you.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create measures. 

Count_lowdistance = var a=SUMMARIZE(ALLSELECTED(Distance),[License],"Flag",[Performance])
return COUNTROWS(FILTER(a,[License] in VALUES(Distance[License])&&[Flag]="LOW DISTANCE"))
Count_performance = var a=SUMMARIZE(ALLSELECTED(Distance),[License],"Flag",[Performance])
return COUNTROWS(FILTER(a,[License] in VALUES(Distance[License])&&[Flag]="ON PERFORMANCE"))
Count_VOR = var a=SUMMARIZE(ALLSELECTED(Distance),[License],"Flag",[Performance])
return COUNTROWS(FILTER(a,[License] in VALUES(Distance[License])&&[Flag]="VOR"))
Sum_countper = SUMX(VALUES(Distance[License]),[Count_performance])
Sum_lowdis = SUMX(VALUES(Distance[License]),[Count_lowdistance])
Sum_vor = SUMX(VALUES(Distance[License]),[Count_VOR])

(3) Then the result is as follows.

vtangjiemsft_0-1692952578309.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create measures. 

Count_lowdistance = var a=SUMMARIZE(ALLSELECTED(Distance),[License],"Flag",[Performance])
return COUNTROWS(FILTER(a,[License] in VALUES(Distance[License])&&[Flag]="LOW DISTANCE"))
Count_performance = var a=SUMMARIZE(ALLSELECTED(Distance),[License],"Flag",[Performance])
return COUNTROWS(FILTER(a,[License] in VALUES(Distance[License])&&[Flag]="ON PERFORMANCE"))
Count_VOR = var a=SUMMARIZE(ALLSELECTED(Distance),[License],"Flag",[Performance])
return COUNTROWS(FILTER(a,[License] in VALUES(Distance[License])&&[Flag]="VOR"))
Sum_countper = SUMX(VALUES(Distance[License]),[Count_performance])
Sum_lowdis = SUMX(VALUES(Distance[License]),[Count_lowdistance])
Sum_vor = SUMX(VALUES(Distance[License]),[Count_VOR])

(3) Then the result is as follows.

vtangjiemsft_0-1692952578309.png

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

Anonymous
Not applicable

Hello @Anonymous Neeko Tang, 

    

   May I ask another one question.  I would like to create bar chart as picture below   from a file i provided earlier.  
Axis Y is count of truck 
Axis X is sum of distance and divided into a group.

JJ8098_0-1693215218139.png

 

How to made bar chart like this but the truck that take into account is only "On Performance" Truck.
Is  it possible with data provided ?

Thank you in advance.

 

Best Regards 

JJ



Anonymous
Not applicable

Hi Neeko Tang,

 

 As I follow your step and the result is satisfied.   Thank you  my life saver.  😘😘🌻

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors