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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Gaurav_84
Helper I
Helper I

Variance calculation dex

Hi Experts,

 

Need your support in calculating variance using dex. Below is how my data look like. 

Table 1 is the plan values for the whole year & table 2 is actual spent for the whole year. Maximum variance allowed is 15% of plan values. i need to display top 10 accounts whose variance is more than 15% when comparing Plan vs actual. 

 

for example account AC1 total plan for the year is $24k & maximum variance allowed is 15% which mean $3600. where as the total spent for the year is $32K as per table 2. So if i compare Plan VS actual my total difference is $8K (24K-32K). which is 20% of plan value.

 

So i need to show this in my bar chart as account AC1 variance% = 20 & amount 8K.

 

Gaurav_84_0-1755563351177.png

 

Regards

 

 

1 ACCEPTED SOLUTION
v-ssriganesh
Community Support
Community Support

Hello @Gaurav_84,
Thank you for reaching out to the Microsoft Fabric Community Forum.

I have reproduced your scenario in Power BI Desktop and I got the expected output as per your requirement. The bar chart highlights the top 10 accounts with variance greater than 15%, and the table visual shows Plan YTD, Actual YTD, Variance Amount, and Variance %. Please find the attached .pbix file for your reference.

Best Regards,
Ganesh singamshetty.

View solution in original post

4 REPLIES 4
v-ssriganesh
Community Support
Community Support

Hello @Gaurav_84,
Thank you for reaching out to the Microsoft Fabric Community Forum.

I have reproduced your scenario in Power BI Desktop and I got the expected output as per your requirement. The bar chart highlights the top 10 accounts with variance greater than 15%, and the table visual shows Plan YTD, Actual YTD, Variance Amount, and Variance %. Please find the attached .pbix file for your reference.

Best Regards,
Ganesh singamshetty.

jaineshp
Memorable Member
Memorable Member

Hey @Gaurav_84,

I'll help you create a variance calculation solution in Power BI. Here's a step-by-step approach:

Solution Steps:

1. Create Calculated Columns:

 

Plan Total = SUMX(Table1, [Jan]+[Feb]+[Mar]+[Apr]+[May]+[Jun]+[Jul]+[Aug]+[Sep]+[Oct]+[Nov]+[Dec])

Actual Total = SUMX(Table2, [Jan]+[Feb]+[Mar]+[Apr]+[May]+[Jun]+[Jul]+[Aug]+[Sep]+[Oct]+[Nov]+[Dec])

Variance Amount = [Actual Total] - [Plan Total]

Variance % = ABS([Variance Amount]) / [Plan Total]

 

2. Filter Top 10 Accounts:

  • Add a filter: Variance % > 0.15
  • Use Top N filter on Variance % (Descending, 10 accounts)

3. Bar Chart Setup:

  • X-axis: Account
  • Y-axis: Variance %
  • Tooltips: Add Variance Amount for detailed view
  • Data Labels: Show Variance % as percentages

4. Format the Visual:

  • Sort by Variance % (highest first)
  • Use conditional formatting to highlight accounts >15%
  • Add reference line at 15% threshold

5. Final Touch:

 

Variance Display =
IF([Variance %] > 0.15,
"Variance: " & FORMAT([Variance %], "0%") & " | Amount: $" & FORMAT([Variance Amount]/1000, "0") & "K",
BLANK())

 

This will give you exactly what you need - top 10 accounts exceeding 15% variance with both percentage and dollar amounts displayed.

 

Fixed? ✓ Mark it • Share it • Help others!


Best Regards,
Jainesh Poojara | Power BI Developer

Thanks @jaineshp : can you please also suggest me how to calculate year to date Plan values. I tried using TOTALYTD formula but it didnt work.

for example if we are in month of august it should sum all the values till current month.

Gaurav_84_0-1755579745650.png

 

regards

 

Hey @Gaurav_84,

Here's the working solution for YTD Plan calculation:

 

Step 1: Create YTD Plan Measure

 

YTD Plan =
VAR CurrentMonth = MONTH(TODAY())
RETURN
IF(CurrentMonth >= 1, [Jan], 0) +
IF(CurrentMonth >= 2, [Feb], 0) +
IF(CurrentMonth >= 3, [Mar], 0) +
IF(CurrentMonth >= 4, [Apr], 0) +
IF(CurrentMonth >= 5, [May], 0) +
IF(CurrentMonth >= 6, [Jun], 0) +
IF(CurrentMonth >= 7, [Jul], 0) +
IF(CurrentMonth >= 8, [Aug], 0) +
IF(CurrentMonth >= 9, [Sep], 0) +
IF(CurrentMonth >= 10, [Oct], 0) +
IF(CurrentMonth >= 11, [Nov], 0) +
IF(CurrentMonth >= 12, [Dec], 0)

 

Step 2: Create YTD Actual

 

YTD Actual = [Apply same formula to your Actual table]

 

Step 3: YTD Variance

 

YTD Variance % = DIVIDE([YTD Actual] - [YTD Plan], [YTD Plan])

 

Since you're in August, it'll sum Jan through Aug automatically.

 

 

Fixed? ✓ Mark it • Share it • Help others!

 

Best Regards,
Jainesh Poojara | Power BI Developer

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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