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
muhammadh811
Regular Visitor

No. of events in a column based on measure

Hello
I have created a measure that shows me if the Venture is "Risky" or "Partial" against each venture. Now I want to count how many trades are "Risky" and how many are "Partial"

 

BI.png
Thanks

1 ACCEPTED SOLUTION

Hi  @muhammadh811 ,

 

Create 2 measures as below:

 

_Risky count = CALCULATE(COUNTROWS('Position Manager - Exported_Gra'),FILTER(ALL('Position Manager - Exported_Gra'),'Position Manager - Exported_Gra'[Status]="Risky"))
_Partial count = CALCULATE(COUNTROWS('Position Manager - Exported_Gra'),FILTER(ALL('Position Manager - Exported_Gra'),'Position Manager - Exported_Gra'[Status]="Partial"))

 

And you will see:

Screenshot 2020-09-23 140228.png

Here,status is a measure per your description.

For details,you may refer to attachment.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

14 REPLIES 14
VijayP
Super User
Super User

@muhammadh811 

https://drive.google.com/file/d/1ty4lgspcNz9loK5ISi-IRfoKdptfMNcW/view?usp=sharing

Find the file

Hope this is what you are looking for if so please mark this as solution and share your Kudoes

Vijay  Perepa

2020-09-21_115158.png




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Just to clarify, I have [Status] as a measure not a column in data. 
First I have created a measure which tells me whether a Venture is "Risky" or "Partial". Now I want to see how many Ventures are "Risky".

@muhammadh811 

Did you try the solution that I shared, It uses your measure.

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@muhammadh811 

Yes if you ignore the column part remaining to measures will tell what exactly you wanted to see.




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


Fowmy
Super User
Super User

@muhammadh811 

You can create two measures as 

Risky Count = 

CALCULATE(
    COUNTROWS('Table'),
    FILTER(
        Table,
        [Status] = "Risky")
)

---------------------------------------------
Partial Count = 

CALCULATE(
    COUNTROWS('Table'),
    FILTER(
        Table,
        [Status] = "Partial")
)

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

BI.png
@Fowmy brother, I am unable to get results that I am looking for.

amitchandak
Super User
Super User

@muhammadh811 , Assume you have create some calculation , where you have like

 

Switch(True(),

<Condition>, "Risky",

/// and so on,

)

 

Same way create a measure that returns 1 for risky and 0 or Blank() when it not risky

 

Sumx(Values(Table[Venture]),

Switch(True(),

<Condition Risky is true>, 1, blank()

))

 

You can use IF in place of Switch.

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

BI.png
I tried your solution but it's not giving the correct number.

@muhammadh811 

The measure I shared is not that, please check it again in my reply. I am getting 11 Risky

Fowmy_0-1600674130177.png

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

@muhammadh811 

Use The measures with Calculate(.....)in my pbix you will get the answer




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


@VijayP 
I can't use [Status] = "Risky" in calculate as "Status" is a measure and BI is throwing an error message.

@muhammadh811 

Can you share the measure you have created to get the Risky,Partial. Based on that i can make soltuion out




Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
MY Blog || My YouTube Channel || Connect with me on Linkedin || My Latest Data Story - Ageing Analysis

Proud to be a Super User!


@VijayP 

Status =
VAR _Value = MIN('Position Manager - Exported_Gra'[Venture])
RETURN
IF(CALCULATE(DISTINCTCOUNT('Position Manager - Exported_Gra'[B/S]), 'Position Manager - Exported_Gra'[Venture] =_Value)>1,"Partial","Risky")

 

Hi  @muhammadh811 ,

 

Create 2 measures as below:

 

_Risky count = CALCULATE(COUNTROWS('Position Manager - Exported_Gra'),FILTER(ALL('Position Manager - Exported_Gra'),'Position Manager - Exported_Gra'[Status]="Risky"))
_Partial count = CALCULATE(COUNTROWS('Position Manager - Exported_Gra'),FILTER(ALL('Position Manager - Exported_Gra'),'Position Manager - Exported_Gra'[Status]="Partial"))

 

And you will see:

Screenshot 2020-09-23 140228.png

Here,status is a measure per your description.

For details,you may refer to attachment.

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.