Quantcast
Channel: Power Pivot forum
Viewing all 4715 articles
Browse latest View live

Turn Calculated Field into a permanent field

$
0
0

Hi all,

I am working with a significant amount of data.  I have created several calculated columns with if statements leading me to a final calculated column with the final answers for each row.   All of the calculated columns to get to this final calculated column are taking up lots of space/data.  I was wondering if there is a way to convert my "final" calculated column into a permanant column that is no longer calculated, but are just values with the final answer, so I can get rid of the other columns that are leading to the "final column"

In simple words, I am trying to change a calculated column, into a text column that is permanent and isn't driven off of anything.

Is there anyway to do this in powerpivot?  


How to show a column containing seconds duration in integer format as HH:MM:SS?

$
0
0

Folks,

I need some advice on the best way to show seconds in the HH:MM:SS format in a PowerPivot model (it will be imported as SSAS Tabular later).

I have been reading some good stuff around the Internet, but I have a couple of issues:

  • I know we have the time dataset in SQL but the fact is that PowerPivot and SSAS Tabular does not have time-only fields. So even if I had a field like 21:12:00, this field would become effectively 30/12/1899 (or another date), followed by the time 21:12:00. Even if I format the field to not show the date but only the time, I can foresee issues with this. I really need only the time.

  • Another issue with the time dataset is that it represents a time of the day. What I really want is a duration, not the time of the day. So I would like to allow users to specify parameters concerning the duration such as less than 5 minutes, more than 30 minutes and so forth and not necessarily the time of the day. There is also the issue that a time field could only go as far as 24 hours -- but it is improbable that we will ever have such duration.

  • So I am torn between what I can do concerning the formating of the field and the parametrisation that users could do.


Any suggestions? Thank you all for your help!

Best regards,
P.



Calculating interest payable on partial loan pre-payment

$
0
0

In the Excel data model I need to calculate the interest that becomes payable when the principal of a loan is partially repaid, where:

Payable interest = (Total interest accrued to date - Any amount already payable) x Repaid amount / Outstanding amount before repayment

Sample data is here https://www.dropbox.com/s/az1pte2c9u1o50o/Sample%20loan%20data.xlsx?dl=0

The yellow column is what I am trying to reproduce in DAX

The problem is when there are a series of repayments.  I am using Power Pivot DAX and I get a circular reference error when trying to subtract the sum of the amounts already payable.  I have the repayment number, the total interest accrued to date and the ratio of  the repaid amount to the outstanding amount before repayment as three columns of my Excel data model.

I think the problem in mathematical terms looks like the following, where Ax is the amount of interest accrued at the date of the xth repayment, and rx is the ratio of repaid amount to outstanding amount before repayment:

Repayment number     Ratio of amounts      Interest accrued      Payable interest

   1                                    r1                                 A1                   r1 x A1

   2                                    r2                                 A2                   r2 x (A2-r1A1)

   3                                    r3                                 A3                   r3 x (A3-r2(A2-r1A1)-r1A1)

   4                                    r4                                 A4                   r4 x (A4-r3(A3-r2(A2-r1A1)-r1A1)-r2(A2-r1A1)-r1A1)

etc. etc.

What would be the formula for a calculated field in Power Pivot that gives the Payable interest given the first three columns?  

Grateful for any help

PowerPivot + RUNAS domain credentials

$
0
0

I can do a runas command and run management studio (SSMS) from one domain into another and connect to SQL Server or Analysis Services like this:

"C:\Windows\System32\runas.exe" /netonly/user:domain\user"c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"

However, when I do the same with Excel I can only connect to the relational SQL Engine and not SSAS for PowerPivot data sources:

"C:\Windows\System32\runas.exe" /netonly/user:domain\user"c:\Program Files\Microsoft Office\Office14\EXCEL.EXE"

When I try to connect to a SSAS server to get a list of database names I get the following error:

Unable to retrieve list of databases. Reason: Failed to connect to the server. Reason: The following system error occurred: The system detected a possible attempt to compromise security. Please ensure that you can contact the server that authenticated you.

 

Does anyone know of a work around or if this is possible?

Thank you,

 

 


Robert

Help With Advanced Calculation

$
0
0

I'm new to power pivot so please bear with me :)

I'm trying to perform a calculation as such. Imagine I have a data set for an entire year, which includes a total price for each transaction. Let's say

(Price Table)

1/1/2014, Blue Organization, $5.00

1/1/2014, Red Organization, $10.00

3/1/2014, Blue Organization, $15.00

3/1/2014, Red Organization, $20.00

In the month of Jan, Blue had 20 people, Red had 40. And in the month of March, Blue had 30, and Red had 60.

This member ship count can be stored in a different table, maybe something like this (note, there would be no unique key).

(Member Table).

1/1/2014, Q1, Blue Org, 20

1/1/2014, Q1, Red Org, 40

3/1/2014, Q1, Blue Org, 30

3/1/2015, Q1, Red Org, 60

I'd like to add a new column to show the cost per membership. Members don't cost equally the same, so I'm looking for a cost per month and per quarter.

So in Jan, Blue would be 5/20 and Red would be 10/40. In March, Blue would be 15/30 and Red would be 20/60. For quarterly, Blue would be 20/50 and Red would be 30/100.

Hope this makes sense. I'd like to add calculated columns in the price table, that takes the total for a given transaction, and divides by an appropriate number. That number comes from the member table. Given a date and org, I can find the appropriate monthly membership and quarterly membership (which would consist of adding multiple lines in the member table).

I'm hoping there is a function or set of functions I could use to help get me started. 

Thanks!



How to unlink from excel table, keep calcs, change connection to PowerQuery source?

$
0
0

Hi all,

I've used powerquery to populate a number of excel tables

I then manually added these tables to my powerpivot model and spent considerable time defining relationships, KPIs, measures and calculations, and of course powerview reports etc

I upload the workbook to powerbi and try to set up a scheduled refresh but get errors stating that there's no data connections defined. It seems excel online is too dumb to recognise a "connection -> table -> powerpivot" data flow

I can set the PQ to add the results directly to the model, (and powerbi recognises this as a refreshable data source) but this of course creates a brand new table1 in my model. I can't accept that I'll need to completely rebuilt my model from the ground up just because I want to change a data source.

How do I change the data source for the existing linked table to use the PQ instead? deleting the 'linked_table' from the connections in the workbook drops the table and all calcs from the model


Jakub @ Adelaide, Australia Blog

Calculate - Filter to the current year without hard coding the year

$
0
0

Hi,

I'm working on a fairly simple dashboard using a few CUBEVALUE() formulas to display my measures (current year totals of each type of calls). Instead of creating a filter and applying the current year, I'm trying to add a filter to my calculate measure that filters for the current year based on today's date. My thought is if I do it this way, I won't have to go in and changed the "Year" filter of the measures. I can create a filter, apply theCUBEVALUE() formula and hide it, but that seems a bit inefficient. I have several years of data in my data model. I could also just limit the data model to the current year, but I would also have to change that each new year. 

=CALCULATE(DISTINCTCOUNT(apparatus[incidentkey]),
                        uv_901INCIDENT[Code_Category]="1",
                        ADD FILTER HERE FOR CURRENT YEAR
                        )

I thought about creating a DATESYTD(), but I would still need to use a filter, which would require to be changed each year (I think). 

Thanks for any help. Brent


Brent

Calling all Power Pivot fans! Your chance to win love and glory! Be our November TechNet Guru!

$
0
0

November has been designated National Novel Writing Month and National Blog Posting Month.

But we don't want that! We want a professional wiki article!

TechNet Wiki provides anyone the chance to contribute Microsoft technology related content to the community!

And we'll love it, and tweak it, and show the world!

Everyone has an equal chance of becoming our TechNet technology Guru, every month.

Separate teams of judges (6-8 per category) read every article submitted.

Some of the most influential members of Microsoft in your favourite technologies contribute their judging time to this competition.

TechNet Guru awards also help to promote your progress within the community... and its inner circles.

These competitions also help towards real awards, even MVP recognition!

 

All you have to do is add an article to TechNet Wiki from your own specialist field. Something that fits into one of the categories listed on the submissions page. Copy in your own blog posts, a forum solution, a white paper, or just something you had to solve for your own day's work today.

Drop us some nifty knowledge, or superb snippets, and become MICROSOFT TECHNOLOGY GURU OF THE MONTH!

This is an official Microsoft TechNet recognition, where people such as yourselves can truly get noticed!

HOW TO WIN

1) Please copy over your Microsoft technical solutions and revelations toTechNet Wiki.

2) Add a link to it on THIS WIKI COMPETITION PAGE (so we know you've contributed)

3) Every month, we will highlight your contributions, and select a "Guru of the Month" in each technology.

If you win, we will sing your praises in blogs and forums, similar to the weekly contributor awards. Once "on our radar" and making your mark, you will probably be interviewed for your greatness, and maybe eventually even invited into other inner TechNet/MSDN circles!

Winning this award in your favoured technology will help us learn the active members in each community.

Feel free to ask any questions below.

More about TechNet Guru Awards

Thanks in advance!
Pete Laker


#PEJL
Got any nice code? If you invest time in coding an elegant, novel or impressive answer on MSDN forums, why not copy it over toTechNet Wiki, for future generations to benefit from! You'll never get archived again, and you could win weekly awards!

Have you got what it takes o become this month's TechNet Technical Guru? Join a long list of well known community big hitters, show your knowledge and prowess in your favoured technologies!


NUMBER DAY WORKING

$
0
0

Dear,

The month have 30,31 days, except February.
It's possible only show days business or working days.
For example, 

01 nov 2014 = 0
02 nov 2014 = 0
03 nov 2014 = 1
04 nov 2014 = 2
05 nov 2014 = 3
06 nov 2014 = 4
07 nov 2014 = 5
08 nov 2014 = 0
09 nov 2014 = 0
10 nov 2014 = 6
11 nov 2014 = 7
.....

The idea is to compare this month with any other month, but only days working.

I'm working on PowerPivot and I'm trying to dax formulas.
SWITCH (WEEKDAY ([Date]); 1; 0; 7; 0; 1)

Thank you very much.
Regards.

Power Pivot Data Refresh - Share files

$
0
0

Hello,

Is there a way to share Power Pivot workbooks without looking for Data Refresh each time? Maybe I can use the data refresh manually?

I have Power Pivot for Excel 2013 (no SharePoint). The Power Pivot data coming from SQL server. In Excel I have the input forms with the data validation based on Power Pivot data.

I want to ignore the SQL connection when I open workbooks and manually to reload data.

How this can be done? From Excel or Power Pivot?

Thank you,

Tanya


TK

Get Matching Item from Unrelated Table - Need Help

$
0
0

I have a two table PowerPivot.

Table A has 1 column:  "Item Code"

Table B has 2 columns:  "Item Code" and "Item Name"

They are in a M2M format.  I am pulling both tables directly into PowerPivot from CSV.  No ETL or ability to use select distinct when I import table B. There are dups in both, but for every "Item Code", there is the same "Item Name" - they always match.

In Table A, I want to create a calculated column to "FINDS" or "LOOKs UP" the value that matches based on TableA(Item Code) = TableB(Item Code) logic.

If this was an aggregation, I would use the calculate(sum(xxx),filter(tableA, tableA ItemCode = tableB ItemCode pattern, but I don't want an aggregation, I just want the Item Name that matches to appear.

I would use VLOOKUP, but I can't seem to make it work in PowerPivot.

Thanks in advance.

Can't locate PowerPivot in my Pro Plus Excel 2013

$
0
0
I have Office Pro Plus 2013 and should have access to the PowerPivot add-in.  When I go to Options->Add-ins->Com Add-ins, PowerPivot is not in the select list.  What I am I doing wrong?

Need help with a calculated column - is there any way to reference a value in the current row?

$
0
0

Hey guys,

I'm a bit of a DAX newbie, and I'm running into a block. I'm creating a Power View report about IT tickets. We are going to be creating a cube to automate the data soon, I'm currently working with a flat Excel Data Table of data to demonstrate the Power View reporting capabilities to the team. I need the default display to show the top 4-5 items basked on the Ticket Count. The three applicable columns I'm using are the TicketID, the ContactReason, and the AssetCategory - all three are text. One slide will show the top five Contact Reasons by Ticket Count, and the other will show the top five Categories by Ticket Count. The users will see this default view, but will be able to change it to see differently ranked items or can clear the ranking slicer altogether.

What I've accomplished so far is to create the Calculated Field [Ticket Count] = COUNTA(Table1[TicketID])

And 2 other calculated fields:

[Contact Rank] = RANKX(ALL(Table1[ContactReason]),[Ticket Count],,,DENSE)

[Asset Rank] = RANKX(ALL(Table1[AssetCategory]),[Ticket Count],,,DENSE)

If I were creating a Pivot Table, this would be great. These fields calculate everything the right way. The problem is, I need to have a Rank slicer on each slide and the calculation by itself contains no data - with no data, there's nothing to slice. I realized I need to actually have columns of data so I can create a slicer. I need each row of the table to show the same [Contact Rank] for every instance of a particular ContactReason (and the same for the [Asset Rank] and AssetCategory). The RANKX formulas pasted into the Calculated Column section only show a value of 1 - with no Pivot table summarizing the fields, it's counting each row's ticket once, giving every line the tied Rank of #1.

I've solved the problem in Excel by creating 2 Pivot Tables on a separate sheet that have the data field and the calculated field for ContactRason and AssetCategory. Then on my Excel Data Table, I've added two columns that do a VLOOKUP and pull over a the Calculated Rank from each Pivot Table that match the ContactReason and AssetCategory fields. This works on the flat Excel Data Table now, but will not be a solutions when we start pulling the data from the cube (and there is no flat table).

What I think I need is an Expression for the RANKX formula that can give me, for each row, the count of all of the times a ContactReason shows up in an entire column. There's only about 100,000 lines of data and each ContactReason or AssetCategory may show up several thousand times. But if I can get the expression to return that count, then the RANKX formula should work in the Column. If it wasn't a DAX formula, I'd use a COUNTIF and say 'Count the entire ContactReason column anytime it's equal to the ContactReason on THIS row', but in DAX I don't know how to reference a single value in a row. I've tried the CALCULATE() formula, but it seems like the filter needs a specific value, and doesn't work on a dynamic "cell" value.

Any help would be greatly appreciated! (I hope it all makes sense!)

PowerPivot empty OData feed, no column definitions

$
0
0

PowerPivot define the columns when consuming an empty OData feed even though the metadata is present (via $metadata)

Is this just a gap and are there any plans to fix it?

Power Pivot Data Type Error

$
0
0

Hi All,

I'm fairly new to Power Pivot & even newer to Power Query (installed it today!).  I have a data table with a column formatted as number.  However, when I add this to the data model is simply gives the error message

"The following system error occurred:  Type mismatch.
Datatype conversion failed for [Table: 'TBL_SMaster_PPT', Column: 'Value', Value: 'TRUE']."

The 'Value' column data type in Power Pivot is showing as 'text'.  I've tried changing the data type in the source table and in the Power Pivot window.  I've even tried adding a calculated column converting it to numbers via Value to no avail.

I can find mention of similar problems on the web but so far haven't found the solution.

NB This is probably not relevant but I created the data table by taking a flat table & converting it to columns via power query.  The forma in the resulting table states 'number'

Rgds

M Short



Rename Model Name and ID using Excel

$
0
0

Hi everyone,

after deployed a tabular model in Analysis Services from an Excel file using "Restore from Power Pivot..."

I connected to the cube with Excel and I could notice that the name of the cube is "Model"

I would like to change it using Excel. I found only one solution using visual studio, then script the database and modify the text file manually.

I think it should be a better way.

Have you any ideas? Any comment will be highly appreciated.

Kind Regards,

DAX - is there a way to get current UTC datetime, or time zone info with NOW()?

$
0
0

I have a workbook data model uploaded to PowerBI.

I want to include a 'last refreshed' datetime value on the front powerview report.

I'd added a NOW() call to my dimdate, which works fine in the workbook on my local machine. But once i upload it to powerbi, now() returns the datetime in UTC. Not very useful...

If i could get a consistent datetime on both, i could do something to +10.5 it to bring it into Aus, or if i could get the time with the timezone set to aest, that'd be great.

any ideas? It obviously has to work as a scheduled refresh inside PowerBI

I dont have any on-premise sql servers or the like i can point it at



Jakub @ Adelaide, Australia Blog

In PowerPivot, can I configure a slicer/timeline to automatically select the recent N days when someone opens the workbook?

$
0
0

For example, is it possible to let a slicer/timeline automatically select last 7 days whenever someone opens the workbook, so that one can always see the latest data without having to manually click/drag to select the most recent time range. Can I achieve this?

Thanks.

How does one relate tables with another in PowerPivot?

$
0
0

We are working with a relational database and have imported the files to PowerPivot.

We are trying to build a highly advanced datamodel (motor) and is having troubles with the relations between the tables(entities?). We can connect through attributts like geography, year and mayby ID.

Does pivot support N:M (Many-Many) relationships?

Is it easier to use MySqL Connectors than Access/Pivot?
http://dev.mysql.com/downloads/connector/

Best regards

Missing "Switch to advanced mode"

$
0
0
I'm missing the Advanced tab in PowerPivot, and the option to switch on advanced mode is not there either. I've checked and downloaded the right version (32-bit), so there shouldn't be any problems. Does anyone have any idea how to fix this?
Viewing all 4715 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>