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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
clock0928
Helper I
Helper I

Table Visual - Row duplicates with new calculated column

Hi all,

 

I am working on a table visual that seems to be functioning exactly how I want it to... Until I add an additional feature of a calculated column.

 

Below is my current table - 

clock0928_0-1701060627985.png

Where I then want to add a column at the end, which identifies the last two columns (Calculate & Incoming) and returns a "Match" or "No Match"

Column formula is - IF('Incoming Stats'[Incoming] = [Calculate], "Match", "No Match")

Table with additional column -

clock0928_1-1701060987565.png

 

I have a bit of data intertwined in the table with multiple data sets, listed below -

- Team Members (First column, can't include due to TM names)

- Calendar (WeekOfYear)

- Work On Hand (wkA &WkB (WOH))

- Daily Stats (wkB (Completed))

- Incoming Stats (Calculate & Incoming)

 

Daily Stats, Incoming Stats & Work On Hand are linked to both the Calendar and Team Members table via "1 to Many".

Is there anything that I am missing on why this may be causing a duplicate row for each item when adding the additional column?

3 REPLIES 3
danextian
Super User
Super User

Hi @clock0928 

What happens is you are comparing a measure, [Calculate], which doesn't have  a row context by default,  against a row value in a column which has a row context. Since the measure doesn't have row context, it is as if there are no filters applied to it (think about its value when it is placed in a blank canvas without any slicers/filters at all). So you either compare [Calculate] against another measure or apply a filter to it.

MEASURE vs MEASURE as a measure =
    [Calculate] = SELECTEDVALUE ( 'Incoming Stats'[Incoming] )

 

Filtered Measure vs Column as a calc column =
CALCULATE (
    [Calculate],
    FILTER ( 'table', 'table'[Column] = EARLIER ( 'table'[Column] ) ... etc
 )
)
    = EARLIER ( 'table'[Another Column] )

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thank you for the reply @danextian , however I am still quite new to Power Bi. When you say "So you either compare [Calculate] against another measure or apply a filter to it." - how would I complete this and get what I have working?

 Hi @clock0928 ,

 

A row context is automatically created when you use a measure in a visual - the per row result depends on the dimensions put in a visual.  For example, a column with one unique value will return a single result and your measure will return just the result for that, that is for the whole of that column. Now, if you add another column, say with five unique values, each value will return its own result.

 

Using your own example, if you use Incoming Stats'[Incoming] in a visual, that will return the unique row value for that column in relation to other columns put in a visual. So if that unique value is "A", SELECTEDVALUE ( 'Incoming Stats'[Incoming] ) will return "A" and the complete measure will return "match" if [CALCULATE] is SELECTEDVALUE.  This measure is evaluated based on the visible rows.

 

Your original formula is comparing a measure that doesn't have a row context by default against each row value in 'Incoming Stats'[Incoming]. Try creating a calculated column with just [CALCULATE] and you will know why you're getting an unexpected result.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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