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
juliausha
Helper I
Helper I

Combine two graphs with different values but similar content

How can I combine 2 graphs into one when the values have different meaning (one is # App Views, another one is # Purchases) but on a surface have  similar values: '0, 1, 2, 3, 4, 5, etc."

 

At the momnent I have these 2 graphs: 

juliausha_0-1637936854289.png

 

Here you can find the actual .pbix file: https://www.dropbox.com/s/yhua9xszvcmj2df/My%20test1.pbix?dl=0 

 

I need to combine them into one: 

juliausha_1-1637937061585.png

Thanks in advance for your answer! 

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @juliausha ,

My idea is to create two separate calculation tables, convert measure into columns in the tables, and finally present the results in a summary table:

Sheet2:

custom table:
sheet2 = VALUES(Sheet1)
measure:
sheet2AppVisits = CALCULATE(
	DISTINCTCOUNT(Sheet2[User]),
	FILTER(
		ALLSELECTED(Sheet2),
		ISONORAFTER(Sheet2[App Visits], MIN(Sheet2[App Visits]), ASC)
	)
)
new colmn:
Column = sheet2[sheet2AppVisits]

vluwangmsft_0-1638340991008.png

 

Sheet3:

sheet3 = VALUES(Sheet1)
measure:
sheet3purchases = 
CALCULATE(
	DISTINCTCOUNT(Sheet3[User]),
	FILTER(
		ALLSELECTED(Sheet3),
		ISONORAFTER(Sheet3[Purchases], MIN(Sheet3[Purchases]), ASC)
	)
)
column:
Column = sheet3[sheet3purchases]

 

vluwangmsft_1-1638341003780.png

 

Final table:

sheetrelation = DISTINCT(UNION(DISTINCT(Sheet1[App Visits]),DISTINCT(Sheet1[Purchases])))

ColumnA = IF(LOOKUPVALUE(sheet2[Column],sheet2[App Visits],sheetrelation[App Visits])=BLANK(),0,LOOKUPVALUE(sheet2[Column],sheet2[App Visits],sheetrelation[App Visits]))

ColumnB = IF(LOOKUPVALUE(sheet3[Column],sheet3[Purchases],sheetrelation[App Visits])=BLANK(),0,LOOKUPVALUE(sheet3[Column],sheet3[Purchases],sheetrelation[App Visits]))

vluwangmsft_2-1638341028088.png

Output:

vluwangmsft_3-1638341060927.png

 

 

 

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


Best Regards

Lucien

View solution in original post

4 REPLIES 4
v-luwang-msft
Community Support
Community Support

Hi @juliausha ,

My idea is to create two separate calculation tables, convert measure into columns in the tables, and finally present the results in a summary table:

Sheet2:

custom table:
sheet2 = VALUES(Sheet1)
measure:
sheet2AppVisits = CALCULATE(
	DISTINCTCOUNT(Sheet2[User]),
	FILTER(
		ALLSELECTED(Sheet2),
		ISONORAFTER(Sheet2[App Visits], MIN(Sheet2[App Visits]), ASC)
	)
)
new colmn:
Column = sheet2[sheet2AppVisits]

vluwangmsft_0-1638340991008.png

 

Sheet3:

sheet3 = VALUES(Sheet1)
measure:
sheet3purchases = 
CALCULATE(
	DISTINCTCOUNT(Sheet3[User]),
	FILTER(
		ALLSELECTED(Sheet3),
		ISONORAFTER(Sheet3[Purchases], MIN(Sheet3[Purchases]), ASC)
	)
)
column:
Column = sheet3[sheet3purchases]

 

vluwangmsft_1-1638341003780.png

 

Final table:

sheetrelation = DISTINCT(UNION(DISTINCT(Sheet1[App Visits]),DISTINCT(Sheet1[Purchases])))

ColumnA = IF(LOOKUPVALUE(sheet2[Column],sheet2[App Visits],sheetrelation[App Visits])=BLANK(),0,LOOKUPVALUE(sheet2[Column],sheet2[App Visits],sheetrelation[App Visits]))

ColumnB = IF(LOOKUPVALUE(sheet3[Column],sheet3[Purchases],sheetrelation[App Visits])=BLANK(),0,LOOKUPVALUE(sheet3[Column],sheet3[Purchases],sheetrelation[App Visits]))

vluwangmsft_2-1638341028088.png

Output:

vluwangmsft_3-1638341060927.png

 

 

 

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


Best Regards

Lucien

Hi @v-luwang-msft thank you very much for your solution! It's impressive how you managed to solve it. It works like charm 🙂 

amitchandak
Super User
Super User

@juliausha , Assume these are column values.

You can generate a series as table

Seq = generateseries(1,200,1)

 

Join both these with value column of this table and use value in x-axis of visual

 

If both columns are from one table one join will be inactive. activate that using userelationship in a measure

https://radacad.com/userelationship-or-role-playing-dimension-dealing-with-inactive-relationships-in...

 

 

 

Thank you for your reply @amitchandak . I tried to follow your advise and activate a relationship by creating a new measure "USERRELATIONSHIP". Please see the .pbix file  https://www.dropbox.com/s/mur7p516zm8hzo9/My%20test2.pbix?dl=0

 

It looks like that I did something wrong because one of my joins dosn't work properly: 

juliausha_0-1638193779172.png

 

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.