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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
FergalK
Helper I
Helper I

Incorrect values in pivot table from Tabular model

Hi

I tried for several days to fix this but to no avail so appreciate all/any help!

I have a model built in SSAS Tabular.

When checking my metric in Excel pivot table, it gives the wrong value in the subtotal, but only for a certain condition.

 

Here's the logic for "Rtn_qty_adjust":

If Rtn_qty > UCL, THEN Rtn_qty_avg ELSE Rtn_qty

 

Note "UCL" = Upper Control Limit

 

As you can see from the image, the subtotals are correct anywhere that Rtn_qty < UCL,  but where Rtn_qty > UCL, then they are wrong.

 

Here is the DAX I have for "Rtn_qty_adjust":

 

:=
IF(COUNTROWS(VALUES(dates[incr_base_date])) =1, [Rtn_qty_adj_1]
,
SUMX
(
SUMMARIZE(drct_excg, dates[incr_base_date], "rtns", [Rtn_qty_1sd_adj_prd] ),
[rtns]
)
)

 

this relies on the measure "Rtn_qty_adj_1" per below

:=

Rtn_qty_adj_1:= IF( [Rtn_qty] > [UCL], [rtn_qty_avg], [Rtn_qty] )

 

 

 

thanks!!!!

 

dax.png

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @FergalK,

 

I'd like to suggest you to take a look at following blog about deal with calculation on hierarchy level subtotal:

Clever Hierarchy Handling in DAX

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

thanks for that link, I will check it out now

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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