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

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.

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.

 

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.