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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Madhan_
Frequent Visitor

How to calculate the new measure from another measure based on hour as category or group?

I want to create a success rate of mission by time.  The formula is = successful missions by time / total mission by time. For that I have already created a measure for the total mission by time 

 

Total Mission by Time = CALCULATE(count(space_missions[Mission]),ALLEXCEPT(space_missions,space_missions[Hour]))
 
and to filter only successful missions from the table  i created a measure
Successful Missions = CALCULATE([Total Missions],space_missions[MissionStatus]="Success")

 

From this, I want to calculate successful missions by time. For that, i don't know how to calculate a new measure called successful missions by time from the calculated measure of Successful missions based on hours as a group. Could you please help to resolve

 

capture_20221121113722360.jpg

1 ACCEPTED SOLUTION
v-yinliw-msft
Community Support
Community Support

Hi @Madhan_ ,

 

 

I use this as a sample data:

vyinliwmsft_0-1669102416442.png

 

You can try this method:

Create two measures:

SuccessMission =
CALCULATE (
    COUNTROWS ( 'space_missions' ),
    FILTER (
        'space_missions',
        AND ( 'space_missions'[MissionStatus] = "Success", 'space_missions'[Hour] )
    )
)
SuccessfulRate =
DIVIDE (
    'space_missions'[SuccessMission],
    'space_missions'[Total Mission by Time]
)

The result is:

vyinliwmsft_1-1669102416445.png

 

Hope this helps you.

Here is my PBIX file.

Best Regards,

Community Support Team _Yinliw

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

2 REPLIES 2
v-yinliw-msft
Community Support
Community Support

Hi @Madhan_ ,

 

 

I use this as a sample data:

vyinliwmsft_0-1669102416442.png

 

You can try this method:

Create two measures:

SuccessMission =
CALCULATE (
    COUNTROWS ( 'space_missions' ),
    FILTER (
        'space_missions',
        AND ( 'space_missions'[MissionStatus] = "Success", 'space_missions'[Hour] )
    )
)
SuccessfulRate =
DIVIDE (
    'space_missions'[SuccessMission],
    'space_missions'[Total Mission by Time]
)

The result is:

vyinliwmsft_1-1669102416445.png

 

Hope this helps you.

Here is my PBIX file.

Best Regards,

Community Support Team _Yinliw

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

amitchandak
Super User
Super User

@Madhan_ , You can use date table and time intelligence

MTD Successful Missions= CALCULATE([Successful Missions],DATESMTD('Date'[Date]))
last MTD Successful Missions= CALCULATE([Successful Missions],DATESMTD(dateadd('Date'[Date],-1,MONTH)))

 

 

Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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