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
Kristofferaabo
Helper IV
Helper IV

Create a Calculated table

Hi, I'm new to calculated tables. But I think I need this as my raw dataset is not expressed the way I want it. Therefore I have two questions related to below raw data screenshot:

2018-02-19_15-08-12.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I would like to build a new table with following type of columns:

1. One type of coloumn which returns the same parameter for instance 'Project code' but it should not return 'distinct' as I have multiple values of these.

 

2. A bit more advanced: Can I create a column which returns the dates in columns C if column B has a specific name like 'Budget approved'. In a nut sheel I would like to have a column named 'Budget approved' and the dates as rows.

 

I'm able to create all this in a pivot table in excel, but I would like to let powerBI handle it instead.

2018-02-19_15-24-24.jpg

 

 

 

 

 

 

Thanks

Kristoffer

1 ACCEPTED SOLUTION

Hi @Kristofferaabo,

 

Could you try the formula below to see if it works? Smiley Happy

Table =
SUMMARIZE (
    'Table1',
    'Table1'[project Code],
    'Table1'[last_name],
    "Budget approved", CALCULATE (
        FIRSTNONBLANK ( 'Table1'[actual_date], 1 ),
        FILTER ( 'Table1', 'Table1'[milestone_name] = "Budget approved" )
    ),
    "Budget submitted", CALCULATE (
        FIRSTNONBLANK ( 'Table1'[actual_date], 1 ),
        FILTER ( 'Table1', 'Table1'[milestone_name] = "Budget submitted" )
    )
)

 

Regards

View solution in original post

4 REPLIES 4
v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @Kristofferaabo,

 

If I understand you correctly, you should be able to use the formula below to create a new calculate table to get the expected result in your scenario. Smiley Happy

Table =
SUMMARIZE (
    'Table1',
    'Table1'[project Code],
    'Table1'[last_name],
    "Budget approved", CALCULATE (
        FIRSTNONBLANK ( 'Table1'[actual_date], 1 ),
        FILTER ( 'Table1', 'Table1'[milestone_name] = "Budget approved" )
    )
)

Note: You'll need to replace 'Table1' with your real table name.

 

Regards

Hi @v-ljerr-msft, this is really cool. Exactly what I was looking for. Perhaps a stupid question, But I was trying to include another column as I wanted a couple of these columns in my data (basically because I want to calculate time between each columns).

I tried something lik ethis, but it gives me a "TRUE/FALSE error"

 

Table =
SUMMARIZE (
    'Table1',
    'Table1'[project Code],
    'Table1'[last_name],
    "Budget approved", CALCULATE (
        FIRSTNONBLANK ( 'Table1'[actual_date], 1 ),
        FILTER ( 'Table1', 'Table1'[milestone_name] = "Budget approved" ),
"Budget submitted", CALCULATE (
        FIRSTNONBLANK ( 'Table1'[actual_date], 1 ),
        FILTER ( 'Table1', 'Table1'[milestone_name] = "Budget submitted" )
) )

 

 

Hi @Kristofferaabo,

 

Could you try the formula below to see if it works? Smiley Happy

Table =
SUMMARIZE (
    'Table1',
    'Table1'[project Code],
    'Table1'[last_name],
    "Budget approved", CALCULATE (
        FIRSTNONBLANK ( 'Table1'[actual_date], 1 ),
        FILTER ( 'Table1', 'Table1'[milestone_name] = "Budget approved" )
    ),
    "Budget submitted", CALCULATE (
        FIRSTNONBLANK ( 'Table1'[actual_date], 1 ),
        FILTER ( 'Table1', 'Table1'[milestone_name] = "Budget submitted" )
    )
)

 

Regards

YOU ARE WIZARD! Thanks

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

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.