<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Difference in Total Revenue amount in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-in-Total-Revenue-amount/m-p/4728820#M181145</link>
    <description>&lt;P&gt;There's nothing wrong with the measure you wrote, and there doesn't appear to be anything wrong with the model you've created, so I think the problem is likely in the underlying data.&lt;/P&gt;
&lt;P&gt;I would start by creating a table visual with month name and [Total Revenue] and compare that with the results from Excel. If there is a blank row in Power BI then that would indicate that either there are rows missing a date or that there are rows with dates outside the date range covered by your date table.&lt;/P&gt;
&lt;P&gt;You might also want to import the Excel data directly into Power BI without any transformations. That way you could write measures against both versions of the data and compare the results.&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jun 2025 14:15:33 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2025-06-11T14:15:33Z</dc:date>
    <item>
      <title>Difference in Total Revenue amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-in-Total-Revenue-amount/m-p/4728733#M181142</link>
      <description>&lt;P&gt;Hi all, I'm new to Power BI. I did a project in Excel and want to replicate this in Power BI. The problem that I'm faced with, is with the Total Revenue amount. In the screenshot below, the correct Total revenue amount should be $698812.33&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The source file was an Excel workbook with Transactions, Product and Store Location data all combined into a single sheet. So I split these up into separate tables to create a data model which looks like this...&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To calculate Total Revenue, I used a DAX measure:&lt;/P&gt;&lt;P&gt;Total Revenue = SUMX('Transactions','Transactions'[transaction_qty]*RELATED('Product'[unit_price]))&lt;/P&gt;&lt;P&gt;But, when I used this formula, it gives me answer below.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please can someone assist me to figure out where I'm going wrong, thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 13:02:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-in-Total-Revenue-amount/m-p/4728733#M181142</guid>
      <dc:creator>Anonymous00729</dc:creator>
      <dc:date>2025-06-11T13:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in Total Revenue amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-in-Total-Revenue-amount/m-p/4728820#M181145</link>
      <description>&lt;P&gt;There's nothing wrong with the measure you wrote, and there doesn't appear to be anything wrong with the model you've created, so I think the problem is likely in the underlying data.&lt;/P&gt;
&lt;P&gt;I would start by creating a table visual with month name and [Total Revenue] and compare that with the results from Excel. If there is a blank row in Power BI then that would indicate that either there are rows missing a date or that there are rows with dates outside the date range covered by your date table.&lt;/P&gt;
&lt;P&gt;You might also want to import the Excel data directly into Power BI without any transformations. That way you could write measures against both versions of the data and compare the results.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 14:15:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-in-Total-Revenue-amount/m-p/4728820#M181145</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2025-06-11T14:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in Total Revenue amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-in-Total-Revenue-amount/m-p/4728922#M181146</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="1261827" data-lia-user-login="Anonymous00729" class="lia-mention lia-mention-user"&gt;Anonymous00729&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You're on the right track by building a star schema and using DAX. The issue you're facing&amp;nbsp;&lt;STRONG&gt;a mismatch in total revenue between Excel ($698,812.33) and Power BI ($700,779.74)&lt;/STRONG&gt;&amp;nbsp;likely stems from data model or calculation inconsistencies introduced during normalization. Here's a detailed breakdown of what might be going wrong and how to troubleshoot it.&lt;/P&gt;&lt;H3&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Quick Summary of Your Current Setup&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Excel Calculation:&lt;/STRONG&gt; Flat file with correctly aggregated revenue = $698,812.33&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Power BI Model:&lt;/STRONG&gt; Star schema with:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Transactions fact table&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Product, Store Location, Date dimension tables&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;DAX Measure:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;Total Revenue = SUMX('Transactions', 'Transactions'[transaction_qty] * RELATED('Product'[unit_price]))&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;&amp;nbsp;&lt;/H3&gt;&lt;H4&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;1. Join Multiplication (Many-to-One Mismatch or Duplicates in Product)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;&lt;P&gt;If Product[product_id] is not unique, or there are hidden duplicates in Product, the RELATED() function will return multiple matches, causing the measure to &lt;STRONG&gt;overcalculate&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Action:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Go to Product table → Check for duplicate product_ids.&lt;/P&gt;&lt;PRE&gt;Duplicates = COUNTROWS(FILTER(Product, CALCULATE(COUNTROWS(Product)) &amp;gt; 1))&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Ensure that Product[product_id] is set as a &lt;STRONG&gt;primary key&lt;/STRONG&gt; and is unique.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H4&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;2. Rounding Issues&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;&lt;P&gt;Excel sometimes rounds differently than Power BI. But your difference (~$2,000) is &lt;STRONG&gt;too large for rounding errors&lt;/STRONG&gt;&amp;nbsp;so this is unlikely the core issue.&lt;/P&gt;&lt;H4&gt;&lt;STRONG&gt;&lt;FONT color="#000000"&gt;3. Hidden or Extra Rows in Power BI Transactions&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/H4&gt;&lt;P&gt;Power BI may be reading extra rows due to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Empty or malformed rows&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Rows filtered out in Excel that aren't in Power BI&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Action:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Compare row count in Excel vs Power BI for the Transactions table.&lt;/P&gt;&lt;PRE&gt;TotalRows = COUNTROWS('Transactions')&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H4&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;4. Currency Format or Separator Interpretation&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;&lt;P&gt;In your Power BI card visual, 700,78K is shown this is a European decimal separator (, for decimals, . for thousands). It might just be a visual formatting issue, not a logic issue.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Action:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Check locale and format settings under &lt;STRONG&gt;Model → Format → Currency&lt;/STRONG&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H4&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;5. Extra Products or Incorrect Prices&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H4&gt;&lt;P&gt;Since you're multiplying by RELATED('Product'[unit_price]), ensure:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;There are no extra rows with higher unit prices&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Products align correctly with transactions&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Action:&lt;/STRONG&gt;&lt;BR /&gt;Try validating with a basic table:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;product_id, transaction_qty, unit_price, transaction_qty * unit_price&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Alternate Approach: Use MERGE in Power Query&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;P&gt;To ensure that unit_price is correctly assigned per transaction row:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;In Power Query:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Merge Transactions with Product using product_id&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Create a new column transaction_amount = transaction_qty * unit_price&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Then SUM that column in Power BI&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;H3&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;Recommended Fix&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/H3&gt;&lt;P&gt;If you're sticking to DAX:&lt;/P&gt;&lt;PRE&gt;Total Revenue = 
SUMX(
    ADDCOLUMNS(
        'Transactions',
        "Price", RELATED('Product'[unit_price])
    ),
    'Transactions'[transaction_qty] * [Price]
)&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Then verify by comparing this measure against individual rows in a table visual.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/nasif-azam-9aa2331a0/" target="_blank" rel="noopener nofollow noreferrer"&gt;Nasif Azam&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 15:07:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-in-Total-Revenue-amount/m-p/4728922#M181146</guid>
      <dc:creator>Nasif_Azam</dc:creator>
      <dc:date>2025-06-11T15:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in Total Revenue amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-in-Total-Revenue-amount/m-p/4728936#M181147</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240987" data-lia-user-login="johnt75" class="lia-mention lia-mention-user"&gt;johnt75&lt;/a&gt;&amp;nbsp;thank you so much for your help. This was actually a guided project done in Excel. Whilst I followed the instructor's exact steps in Excel, he didn't split the data up into different tables and add to the data model. He was trying to demonstrate the use of PivotTables. So, I wanted to take a different approach and try this in Power BI, when I ran into this issue. Upon closer inspection of my data, there was product_id 9 which was the problem. It shows 1 distinct and 0 unique values for the unit_price column which isn't true because in the screenshot below, there were other values present that I wasn't aware of.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I initially removed any duplicates and this is what caused me to have a slightly inflated figure for Total Revenue. When I removed the 'removed duplicate' step, I got the same value as I did in Excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for pointing me back to my data, I greatly appreciate it.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 15:17:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-in-Total-Revenue-amount/m-p/4728936#M181147</guid>
      <dc:creator>Anonymous00729</dc:creator>
      <dc:date>2025-06-11T15:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Difference in Total Revenue amount</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-in-Total-Revenue-amount/m-p/4728985#M181148</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="871356" data-lia-user-login="Nasif_Azam" class="lia-mention lia-mention-user"&gt;Nasif_Azam&lt;/a&gt;&amp;nbsp;, that's exactly what happened. The unit_price column misled me to believing that only one unit_price existed for product_id 9 so when I removed duplicates, I thought I'd be removing the duplicates of just one unique value only to realise that values others existed to but, didn't show up in the column statistics.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for pointing me in the right direction. I greatly appreciate it.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 16:04:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Difference-in-Total-Revenue-amount/m-p/4728985#M181148</guid>
      <dc:creator>Anonymous00729</dc:creator>
      <dc:date>2025-06-11T16:04:45Z</dc:date>
    </item>
  </channel>
</rss>

