USERELATIONSHIP in CALCULATE function returning wrong results - excel

I am new to DAX and Power Pivot, I apologize in advance if there is a similar thread I did not see. I am using Excel 2016, I need to use USERELATIONSHIP in the CALCULATE function to use an inactive relationship in the data model (I need it for a slicer).
I am using this formula =CALCULATE([Count of Fiscal Week Identified],USERELATIONSHIP(Table[Fiscal Week Identified],Week[Week])) to create a calculated field I need to add to a pivot table.
I just need Excel to generate the pivot table on the left in the screenshot using a calculated field inserted in values, and the field 'week' in rows (having an inactive relationship in the data model). When I tried using the formula above, I get the table on the right which is completely different from the table on the left, and I cannot figure out why... I need this to include the pivot table in a slicer. Any help would be very much appreciated. Thank you in advance!
Regards,

The problem is that even though you are creating column using USERELATIONSHIP, the relationship isn't active when this column is evaluated in Pivot Table. So you need to use a Measure. Is the below the expected result?
If yes, then create a measure like this:

Related

Continuous Running total in Excel Power Pivot

I would like to display/calculate my running total in pivot table in excel until the next year without resetting every other year.
Any workaround ideas to achieve my desired outcome?
You can solve this issue partially by Un-grouping the date fields. It worked for me like that.
This still doesn't work for the grouped date fields.
Another turn around is to add field/s for the cumulative formula manually to the table, then show them in the pivot table while selecting "MAX" instead of "SUM" as the type of calculation.

Power Pivot Many to Many Relationship

Please help.
Simply put I am trying to get the calculated column in table 3 to display the participation number from table 2. Need it to filter by name and date.
The formula in the calculated column is my attempt which doesn't work.
Any help or questions would be appreciated.
One way to do it would be:
=LOOKUPVALUE(Table2[Participation Num],Table2[Name],Table3[Name],Table2[Date],Table3[Date])

Excel - How to look up data in a pivot table and use the values in the next cell?

I have a Pivot table like this
I try to convert this to a user table with all names and have the data listed by day
I tried to use VLookup bus not being succesfull in separating the code in a column structure.
Apologies for the pictures I tried to add a table structure but it didn't work out.
Any suggestions please?
My approach is to isolate regions based on the date you provide, then vlookup on that area, here is the formula, you can try:
C18==IFERROR(VLOOKUP($B18,INDEX($B$3:$B$15,MATCH(C$17,$B$3:$B$15,0)):INDEX($C$3:$C$15,IFERROR(MATCH(D$17,$B$3:$B$15,0),13)),2,0),"")

GetPivotData with a filter

I want to use several GetPivotData functions, retrieving data from the same Pivot table. I want each of them to retrieve different data based on a filter value.
For instance:
Get Pivot Data for Month:January
Get Pivot Data for Month:February
Where Month is a filter on the Pivot. Is this possible using a formula?
I hope this will solve your problem. Try this workaround from Microsoft:
https://support.microsoft.com/en-us/help/287736/getpivotdata-formula-is-automatically-created-when-you-try-to-create-s
When you change the month, the value changes too. But make sure that there are no hidden items (because if not, you won't get an accurate #/data).
see the screenshot below where the Month to choose is based on a cell reference as an argument in the GETPIVOTDATA formula:
Victor,
The Pivot tables won't work like you intend to. All data that your formula shall retrieve must be visible at the same time. I suggest that you arrange for some space on your worksheet and apply the solution proposed by Scott.
NB: If you want to deal with data added month by month, for example, there is an Pivot table option to automatically add new values to the filter. Then in your formula you can use IFERROR to show blank cells when there is still no data available.
Regards,
+Daniel+

Problems with Date Intelligence in Power Pivot (Excel 2013)

I am working with a PowerPivot model where I want to add date intelligence formulas using DAX. I could build the formula and after checking it, Power Pivot says that are ok, nevertheless, the formulas are returning values that are not consistency with what I am expecting.
YTD Formula:
=CALCULATE(TOTALYTD(SUM(V_CONTABILIDAD_EstadosFinancieros[Saldo]),V_CONTABILIDAD_EstadosFinancieros[FinPeriodo]))
The error is that the value that is returning is the same value as Saldo, it means is not accumulating the amount over months.
Last Year Formula
=CALCULATE(SUM(V_CONTABILIDAD_EstadosFinancieros[Saldo]),DATEADD(V_CONTABILIDAD_EstadosFinancieros[InicioPeriodo],-1,YEAR))
The error is that is not giving me any value. The fields InicioPeriodo and FinPeriodo as marked as dates.
Please your advice if I need to check something additional in the model in order that these functions work.
Thanks in advance.
Ok, I resolved it.
It is not about using date tables in the formulas, it should be used in the pivot tables as well, as slicers and fields.
Here the details http://www.powerpivotpro.com/2013/01/calendar-tables-not-just-for-formulas-use-them-on-your-pivots-too/
Now is working beautifully.

Resources