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
WBscooby
Helper III
Helper III

Stacked column chart shows different results to table

Hi

 

I’ve being going around in circles with a problem – sample model attached.

https://1drv.ms/u/s!Ap6q8W-mvm27g-cbmJMXeLGVon-74A?e=7sjOzS

 

I’ve created a measure [#transactions] to find the earliest date of sale for each customer ID and then count where these credentials are matched and it is a new transaction.

 

I then have a second measure [TotalIDs] that sums these.

 

I put these into a stacked column visual against Month for banding and with a legend of Tier. The data looks correct. However, when I click on one of the levels, the table shows different numbers and I just can’t get my head around why?! The numbers are quite close so I’ve screenshot one of the discrepancies.

 

Can anyone help me understand what I am doing wrong?

 

Thank you!

 

Screenshot (85).png

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @WBscooby ,

 

Please try :

TotalIDs = sumx(SUMMARIZE('Sales Transactions','Sales Transactions'[CustomerID],'Sales Transactions'[Month for banding (groups)],'Sales Transactions'[Tier],"Transactions",[#Transactions]),[Transactions])

V-lianl-msft_0-1620614699088.png

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Sorry to ask again - I have spent hours trying to work this out for myself but no luck. Is anyone able to assist? Thank you

Hi

 

This is really helpful, thank you, but unfortunately it is the wrong way around - I don't think I explained that clearly. The correct number in the chart should be 22 and I am trying to get my table to show the same numbers. 

 

With the measure #Transactions I am trying to find the earliest DateOrigSale for each customer and then count the number of [New Sale] after this.

#Transactions =
VAR _id = MAX ('Sales Transactions'[CustomerID])
VAR _date = CALCULATE(Min('Sales Transactions'[DateOrigSale]),ALLSELECTED('Sales Transactions'),'Sales Transactions'[CustomerID] = _id)

RETURN
calculate(count('Sales Transactions'[TransactionID]),
VALUES ('Sales Transactions'[CustomerID]),'Sales Transactions'[CustomerID]= _id,
'Sales Transactions'[DateOrigSale] = _date,
'Sales Transactions'[New Sale]=1)
 
I then am trying to sum these using #TotalIDs to put them into the stacked column chart by tier and month banding
 
TotalIDs = sumx(VALUES('Sales Transactions'[TransactionID]),[#Transactions])
 
The chart looks correct but when I click on it, it appears to change the focus. I think possibly it is counting twice if a customer has transactions with different tiers. I only want to count the tier associated with the first DateOrigSale.
 
Hope that makes sense!
Thank you

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.