cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Deez Frequent Visitor
Frequent Visitor

How to setup a table with 3 calculated columns

Hi,

 

I'm new to Dax and PowerBI and need some help with something that might be easy for you experts.

 

I have:

1.png1 - Data Source

 

 

 

 

 

 

 

 

 

 

 

2.png2 - Combine data into one table

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

What I need to achive is a  front end table visual with a dimension > ID and calculated columns for Source 1, Source 2 & STATUS.

It needs to be a front end table visual and not calculated in the query editor.

3.png3 - Front End table with Calculated columns

 

 

 

 

 

 

 

 

 

 

 

The chalenge for me is the Dax query for "Source 1" & "Source 2".

For Source 1 to return the Name's (A,B,C...) where Source = 1
For Source 2 to return the Name's (A,B,C...) where Source = 2

 

And the STATUS i guess will be an If statement...

 

The aim here is to track the changes between the two sets of data.

 

Any Ideas?

3 REPLIES 3
Super User
Super User

Re: How to setup a table with 3 calculated columns

@Deez hey see attached solution. I did it with two methods.

 

1st method, combined soure 1 and source 2, removed all the column except Id and made it distinct, called this table Source. created relation on id from source (new table) wiht source 1 and source 2. added new column called Status in Source (new table)

 

2nd method, combined soure 1 and source 2, called this table SourceCombine. created 3 measures which you can check in attached file.

 

PS - Ignore other tables in the file, those were for some other use case.






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

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





Deez Frequent Visitor
Frequent Visitor

Re: How to setup a table with 3 calculated columns

Thank you @parry2k for taking the time to help solve this problem!

Just a question on method 2 which i am interested in using.

 

What can we substitute the max function with if there are multiple values per ID  (The ID in my case is not unique per line)?

Source 2 = CALCULATE( MAX( SourceCombine[Name] ), SourceCombine[Source] = 2 )

Max would return one row with the maximum string for that ID. I would need to show all values for that non-unique ID.
 
Something like ID 4 in the snap below:
4_multiple_values_per_ID.png
 
 
 
 
 
 
Any idea?
 
 
 
Super User
Super User

Re: How to setup a table with 3 calculated columns

@Deez if you have more thn one value for an Id, I guess you have some other unique identifier which you need to include in your matrix visual. It is always good to post your question more close to real time data as solution could be totally different based on data model. FYI.






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

Proud to be a Datanaut! Appreciate your Kudos Smiley Happy
Feel free to email me with any of your BI needs.





Helpful resources

Announcements
GregDeckler

How to Get Your Question Answered Quickly

Power BI Super User, Greg Deckler, explains

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Ideas
Users Online
Currently online: 33 members 958 guests
Please welcome our newest community members: