DAX formula working in Power BI but not PowerPivot - excel

I used the new quick measure feature in Power BI to create the below DAX formula. This is a running total based on a Period column that is in the format P01, P02, P03,...P12.
YTD =
CALCULATE(
SUM('Combined Data'[Period Value]),
FILTER(
ALLSELECTED('Combined Data'[Period]),
ISONORAFTER('Combined Data'[Period], MAX('Combined Data'[Period]), DESC)
)
)
This works perfectly in Power BI. I am trying to replicate this data model in PowerPivot so I can work on the same model in Excel. However the same DAX formula in PowerPivot returns an error that the MAX function can only be used on numeric data.
Data has been imported to the data model using Power Query with exactly the same script as in Power BI.
Why is the same DAX code not being treated in the same way in both programs?

Related

Convert Excel query to Dax measure

Could you help me with DAX calculation for :
=IF(C11=0,"- ",(C21+C26)/C11)
CONDITION
,this is an excel calculation i want same calculation in DAX,Power BI
as per above image
The data isn't structured like a table in power bi. First structure your data into a normalized table format.
Which would your columns will be
Product category Amount
If you have a way to explain your logic that would help. If you write out your logic then maybe that would clarify what you need
To get the answer you want, you will need to do some filtered measures on based off of the product category once you normalize the data. I suggest adding it to power bi and giving it a shot

Subtract rows which are grouped in power bI

I am working on Power BI and have appended the data. Once appended i have grouped data between "R" (revenue) and "C" (cost). Now i want to reduce "R"-"C" in power BI. Can you help me

Excel table filters not recognised in PowerPivot measures

I'm trying to create a parameter table to change the units the figures in my pivot table are presented in. I have:
TransTBL table with my transactions.
Units table with 1; 1,000; 1,000,000 in column A and Units; K's; M's in column B.
Both tables are in my data model.
I added the Units Column B as a slicer to TransTBL, despite the fact they have no connections.
I then tried to create a measure in the Units table on the PowerPivot side to recognise which slicer option was chosen. My measure won't recognise the slicer selection. However it will recognise the filter if I apply it directly to the table in PowerPivot.
I'm using the HASONEVALUE function as described here.
The measure works fine as expected.
AmountDisplay =
IF(
HASONEVALUE(Units[B]),
SUM(TransTBL[Amount]) / VALUES(Units[A]),
SUM(TransTBL[Amount])
)
Can you provide more details on your data or model to see if there are any specific problems associated?

Excel 2013 PowerPivot Table - Many Fact Tables along with a Calculated Field

I am pretty new on creating POWERPIVOT tables. I have searched for a bit of time now to resolve this problem but I have been unsuccessful so far. Here is my problem. As you can see below, I have created a POWERPIVOT table in Excel 2013 that is composed of two FACT tables, which are based on: 1) a sheet where the clients can insert initial budget entries; and, 2) another sheet where the clients can insert the post-initial budget entries. Also, a DIMENSION table has been added to the combination in order to add the following relationships:
Based on these relationships, I have clicked on Insert a PivotTable to create the following POWERPIVOT table that will be used to display the Initial Budget and Adjustments entries for analysis purposes. However, this table does not give me the total of both columns. I have thought that a calculated field would make it happen but this is where I am stucked as nothing let me sum the two columns like I was used to do with regular pivot tables in Excel 2007. The calculation of the two columns would logically equal the Current Budget as shown attached.
Thank you for your help on this.
With Power Pivot you don't use the calculated field feature of pivot table.
You have to put a measure in your data Modell, which you can then add in the value part of the PT. Relationships alone are not enough.
currentBudget := CALCULATE (
SUM ( fInitialBudget[Initial Budget] ) + SUM ( fAdjustement[Adjustements] )
)
if you are new with Power Pivot, I warmly recommend the book of Rob Collie "DAX Formulas for Power Pivot". I got a very good introduction of the PP capability with it. The 2nd Edition is on the way.

Pivot like query access

I am having a huge database of records and I'm finding it to be a nightmare getting to analyse the data.
Objective:
Group my data by Country of Purchase (rows), by Years/Months (rows), by Product (columns) with the Sum of Paid amount being the value.
Let me explain:
Below is a sample excerpt from my table.
And here is the result that I am looking for that I was able to achieve using an Excel Pivot table:
Why use MS Access:
My table has over 3 million records stored across many workbooks, and Excel has a limit of 1m in each sheet. Also Excel crashes more often than not when loading >500k of data.
I installed an older version of MS Access (2010) which has pivot tables option but it was very slow and did not allow me to group correctly. I then tried using a combination of queries and reports to arrive to my result to no avail.
Any help will be very welcome :)
How about doing the aggregation in Access and then the pivot in Excel?
SELECT country, year, month, product, sum(paid)
FROM myTable
GROUP BY country, year, month, product
(year and month based on access functions for date manipulation... alternatively, you could use is as a date to keep date functionality in the pivot - just make it the first of the relevant month)
Then use this as the source of the pivot table. The pivot table then basically just does the formatting - which it can hopefully do quickly enough

Resources