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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Difference Between Budget and Real - Two Datasets

Good Morning My Friends.

 

I'm new to PBI and did not find the solution to my problem seaching in the web.

 

I'll try to explain to you:

 

What I have are two differents Datasets, the first one contains the BUDGET of the Year and the second one the REAL(How much was spend).

 

The Budget Dataset Exemple:

AccountMonth$Departament
1Jan100DP1
1Fev200DP1
1Mar100DP1
2Jan300DP1
2Fev250DP1
3Jan320DP2
4Jan180DP2
4Fev200DP2
5Jan170DP2

 

 

So there are 5 differents departaments and each departament has a lot of differents accounts to manage. Each account has a budget to spend each month of the year.

 

The Real Dataset is how much was really Spend in each account, the difference is that the real dataset has a lot of differents payments checked in to the same Account.

 

Real Dataset Exemple:

DepartamentAccountMonth$Service
DP11120Fix Something
DP11130Buy Something
DP11120Pay Som
DP11110Buy Som
DP12115Fix Som
DP12115...
DP23120...
DP23110...
DP23110...
DP2418...
DP2419...
DP24110...
DP25120...
DP25130...

 

There is a different "Real" Dataset for each month. So I was able to merge them all up when we charge the dataset from a Folder. No problem there.

 

I also alredy did a Dynamic Calendar Dataset so I can use Power Pivot to link the tables.

 

 

The Problem:

 

What i need to do now is to do Real[$] - Budget[$] account by account so i know which account spent more than the Budget and which one has money remaining.

 

So what i thought to do was using DAX Summarize by Account and Month the "Real" Dataset and do a Measure Summarized_Real[$] - Budget[$].

 

I also thought to do a Table.Group using M to the Real Dataset, Grouping its values by Account and Month, and then try to Merge this Grouped Table with the Budget Table by Account and Month, than in a new Column in the Merged Table do the Math Operation....

 

But i do not know if its the better option.

 

All the Dashboard will use this "Difference" between budget and real... The idea is in the future show the top 5,10,15 accounts with more debt, the accounts which has more money. Do some charts with this values showing the Departaments by month and stuff like this.... So this will be an important "column"

 

Do you guys think that any of these solutions may work?

Is there anyway to do its easier?

 

 

Regards,

 

Thanks a lot!

 

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @Anonymous ,

 

I think your Table.Group in Power Query idea sounds fine. This is the way that I would solve the problem if I didn't need the extra detail from the Real table as it would push more calculation and processing away from the data model. I'd almost be tempted to put the variance column into Power Query as well, then just use a SUM([Variance]) measure to display the variance value.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 
Is this problem sloved? 

If it is sloved, could you kindly accept it as a solution to close this case and help the other members find it more quickly?

If not, please feel free to let me know.

 

Best Regards

Maggie

BA_Pete
Super User
Super User

Hi @Anonymous ,

 

I think your Table.Group in Power Query idea sounds fine. This is the way that I would solve the problem if I didn't need the extra detail from the Real table as it would push more calculation and processing away from the data model. I'd almost be tempted to put the variance column into Power Query as well, then just use a SUM([Variance]) measure to display the variance value.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create a date table

date = FILTER(ADDCOLUMNS(CALENDAR(DATE(2020,1,1),TODAY()),"year",YEAR([Date]),"month",MONTH([Date]),"monthname",FORMAT([Date],"mmm")),DAY([Date])=1)

Capture1.JPGCapture2.JPG

Create a measure

$ from budget =
CALCULATE (
    SUM ( 'Table 2'[$] ),
    FILTER (
        'Table 2',
        'Table 2'[Departament] = MAX ( 'Table 3'[Departament] )
            && 'Table 2'[Account] = MAX ( 'Table 3'[Account] )
            && 'Table 2'[month no] = MAX ( 'Table 3'[Month] )
    )
)

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

Top Solution Authors
Top Kudoed Authors