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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
poko
Resolver I
Resolver I

Calculation for the time/date

Good morning community,

 

Can anyone help me to make a calculation in PowerBI for this event in the red circle? any advice would be helpful.

 

poko_1-1729064455031.png

 

Thank you

 

regards

 

Poko

3 ACCEPTED SOLUTIONS
bhanu_gautam
Super User
Super User

@poko , By assuming from current details you have provided you must have an date column 

 

Create a Calculated Column:
Go to the "Modeling" tab in Power BI Desktop.
Click on "New Column".

OfWhichMoreThan5Years =
IF(
    DATEDIFF([Date], TODAY(), YEAR) > 5,
    [TotalNumberOfLeadingCases],
    0
)
 
And if note please share more details for data and output



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

Kedar_Pande
Super User
Super User

Ensure your dataset includes at least the following columns:
State, Total Number of Leading Cases, Years in Stand

 

New measure:

CasesMoreThan6Years = 
SUMX(
YourTableName,
IF(
YourTableName[YearsInStand] > 6,
YourTableName[TotalNumberOfLeadingCases],
0
)
)

 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

View solution in original post

Hi @poko ,

You can create a measure as below to get the count of cases which more than 5 years:

Case of which for more than 5 years = 
CALCULATE (
    DISTINCTCOUNT ( '4CecLeadingCase4'[CecCaseId] ),
    FILTER (
        'CecCaseDetail',
        DATEDIFF ( 'CecCaseDetail'[DefinitiveJudgmentDate], TODAY (), YEAR ) > 5
    ),
    'CecCaseDetail'[Case] = "Stand"
)

vyiruanmsft_0-1729237002830.png

Best Regards

Community Support Team _ Rena
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

7 REPLIES 7
poko
Resolver I
Resolver I

Thank you guys for help seems like it works I got difference due to missing dates in columsn but that's another story need to deal with backend guys,developers. Once again Thank you all.

poko
Resolver I
Resolver I

Hello everyone thank you for responses it works someway but I Don't get the result marked in the red circle above.

 

Hi @poko ,

You can create a measure as below to get the count of cases which more than 5 years:

Case of which for more than 5 years = 
CALCULATE (
    DISTINCTCOUNT ( '4CecLeadingCase4'[CecCaseId] ),
    FILTER (
        'CecCaseDetail',
        DATEDIFF ( 'CecCaseDetail'[DefinitiveJudgmentDate], TODAY (), YEAR ) > 5
    ),
    'CecCaseDetail'[Case] = "Stand"
)

vyiruanmsft_0-1729237002830.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Kedar_Pande
Super User
Super User

Ensure your dataset includes at least the following columns:
State, Total Number of Leading Cases, Years in Stand

 

New measure:

CasesMoreThan6Years = 
SUMX(
YourTableName,
IF(
YourTableName[YearsInStand] > 6,
YourTableName[TotalNumberOfLeadingCases],
0
)
)

 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

All columns must be in the same table?

bhanu_gautam
Super User
Super User

@poko , By assuming from current details you have provided you must have an date column 

 

Create a Calculated Column:
Go to the "Modeling" tab in Power BI Desktop.
Click on "New Column".

OfWhichMoreThan5Years =
IF(
    DATEDIFF([Date], TODAY(), YEAR) > 5,
    [TotalNumberOfLeadingCases],
    0
)
 
And if note please share more details for data and output



Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






sure upload pbix??

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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