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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
SwapnilS
Frequent Visitor

Average over the fiscal year not working.

Hi, I am calculating a value called platform availability based on down time and total minutes in a month. So platform availability = Divide ([Total Down Time] / [Total minutes in month]). Total minutes in month = (total number of clients * minutes in month).
Now I am calculating the average of platform availability over Fiscal Quarter and then over Fiscal year. The value is correct at the quarter level, but it does not return correct number at yearly level. Can some please help.

Below is the fake sample data

 

SwapnilS_0-1623761175579.png

 

Platform Availability =
var Downtimevalue = VALUE( Uptime1[Outage Length (Minutes)])
var TotalDownTime = IF( Downtimevalue = 0, 0, CALCULATE([Total Down Time],
ALLEXCEPT( 'Uptime1', Uptime1[Fiscal QY] )
)
)
var MaxClientonCloud =
CALCULATE(
AVERAGE( Uptime1[Max Clients on Cloud] ),
ALLEXCEPT( 'Uptime1', 'Uptime1'[Fiscal QY] )
)

var MinsinMonth = 43920
var TotalClientMinutes = MaxClientonCloud * MinsinMonth
var Numerator = TotalDownTime
Var Denominator = TotalClientMinutes
var Result = 1- (DIVIDE(Numerator , Denominator))
Return
IF( TotalDownTime = 0,
1, Result
)
2 ACCEPTED SOLUTIONS

HI @SwapnilS,

Calculate columns are different as a measure formula, they are matched with different row content levels.

Calculated Columns and Measures in DAX - SQLBI
For this scenario, I think you need to use the earlier function to manually setting filter ranges based on the current field value instead of on a specific category and its filter effect. (calculate column and measure are work on different data level)

How To Use The EARLIER Function In Power BI - A DAX Tutorial | Enterprise DNA

If you confused about the coding formula, please share a pbix file with some dummy data and your expressions to test.

How to Get Your Question Answered Quickly 

Notice: the data level of power bi.

Database(external) -> query table(query, custom function, query parameters) -> data model table(table, calculate column/table) -> data view with virtual tables(measure, visual, filter, slicer)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

Hi @SwapnilS,

Sure, I hope these links help with your scenario.
BTW, if you confused about the coding formula, you can also share a pbix file with some dummy data that keeps the raw table structures to test.

How to Get Your Question Answered Quickly

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

7 REPLIES 7
SwapnilS
Frequent Visitor

@amitchandak This has not worked. Basically what I want is sum of the numbers at the quarterly level and  divide it by 4. Just showing that in excel.

SwapnilS_0-1623764076897.png

 

HI @SwapnilS,

Calculate columns are different as a measure formula, they are matched with different row content levels.

Calculated Columns and Measures in DAX - SQLBI
For this scenario, I think you need to use the earlier function to manually setting filter ranges based on the current field value instead of on a specific category and its filter effect. (calculate column and measure are work on different data level)

How To Use The EARLIER Function In Power BI - A DAX Tutorial | Enterprise DNA

If you confused about the coding formula, please share a pbix file with some dummy data and your expressions to test.

How to Get Your Question Answered Quickly 

Notice: the data level of power bi.

Database(external) -> query table(query, custom function, query parameters) -> data model table(table, calculate column/table) -> data view with virtual tables(measure, visual, filter, slicer)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi, 

Thank you for the solution. Yes this has worked.

Thank you for the support.

@v-shex-msft 

Thank you for the reply.

I will try your suggestions today. I am facing some issues with my laptop. Once done I will confirm.

Hi @SwapnilS,

Sure, I hope these links help with your scenario.
BTW, if you confused about the coding formula, you can also share a pbix file with some dummy data that keeps the raw table structures to test.

How to Get Your Question Answered Quickly

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
SwapnilS
Frequent Visitor

@amitchandak First of thank you for looking into this, since I am trying this for almost a week. The formulae I pasted above is for a calculated column. This formulae is returning correct number at quarterly level. I have another calculated table, I will try your solution now and let you know.

amitchandak
Super User
Super User

@SwapnilS , I think this because of var MaxClientonCloud =
CALCULATE(
AVERAGE( Uptime1[Max Clients on Cloud] ),
ALLEXCEPT( 'Uptime1', 'Uptime1'[Fiscal QY] )
)

 

it allow filter for Qtr

 

try like

 

// Add year too

var MaxClientonCloud =
CALCULATE(
AVERAGE( Uptime1[Max Clients on Cloud] ),
ALLEXCEPT( 'Uptime1', 'Uptime1'[Fiscal QY], , 'Uptime1'[Fiscal FY] )
)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.