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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Confultant
New Member

Fixed level of detail (complicated?)

Hi,

 

I'm new to PBI but have used Tableau in the past. What I'm trying to do is to replicate something similar to Tableau's 'FIXED' Level of Detail function. 

 

I am trying to analyse a large set of transaction data, but the way the raw data is structured is clunky. Essentially, each line represents an item purchased or a payment, and is only tied together by a transaction ID. Data is also kind of 'duplicated' in the sense that there is a 'number of diners' field that is the same across all lines (see below).

 

What I want to do are the following analyses:

1. Total/average number of diners over time (can't just sum columns because of duplication, as mentioned above)

2. Average number of items sold per transaction

3. Average spend per transaction (can't just sum everything as each ID includes the menu items ordered, and another line for the payment itself, which equals sum of item cost + VAT)

 

In Tableau, what I would do is to AVERAGE number of diners and FIX it to the transaction ID. Similarly, I'd COUNT number of rows and FIX to the transaction ID. I've kind of done the same in PowerBI by creating new columns to COUNTROWS or SUM at the Transaction ID level, example:

 

Count of items sold (use for ID-level analysis) =
CALCULATE(countrows('TABLE'),
ALLEXCEPT(TABLE ,TABLE [Transaction ID]), Table [Record type]="Payment")
 

but this analysis breaks down when I try to analyse by a different measure, e.g., geography.

 

Example: Imagine I have 10 transactions, transaction 1 has 1 item, 2 has 2 items, 3 has 3... I've 'FIXED' the number of diners to each transaction ID. It's OK if you want to analyse at the ID level, but now if I sum or average across another variable, say, time, the resulting output would no longer be accurate because of the different number of records each transaction has. 

 

I know this is long and complicated, but any help appreciated!

 

 

Store IDDateTransaction IDRecord typeItem IDnameItem qtyChargeNumber of diners
0011/1/20241AMenu item265Item A117.94
0011/1/20241AMenu item265Item A128.94
0011/1/20241AMenu item265Item A14.54
0011/1/20241AMenu item265Item A117.94
0011/1/20241AMenu item265Item A16.84
0011/1/20241AMenu item265Item A11.724
0011/1/20241AMenu item265Item A11.724
0011/1/20241AMenu item265Item A134
0011/1/20241AMenu item265Item A284
0011/1/20241AMenu item265Item A154
0011/1/20241AMenu item265Item A3184
0011/1/20241AMenu item265Item A2124
0011/1/20241AMenu item266Item B164
0011/1/20241APayment999Credit card1144.5844
3 REPLIES 3
Confultant
New Member

There's a few things I want to do, but take the analyses wishlist, for example:

 

1. Total/average number of diners over time

2. Average number of items sold per transaction

3. Average spend per transaction

 

I want to put these into a time series matrix table, e.g., each row is a month, then in Jan/Feb/Mar, things like the sum total of transactions, sum total of items sold, as well as, per receipt (transaction ID), the average spend, average number of items purchased etc.

OK, go ahead and implement all this in Power BI, I don't see any showstoppers.  Note that if you are looking for LOD - Power BI does not support automatic bucketing, you need to bring your own buckets. 

 

If you like further help please provide sample data that fully covers your issue.
Please show the expected outcome based on the sample data you provided.

lbendlin
Super User
Super User

What is the expected outcome based on your sample data?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.