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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
NewbieJono
Post Patron
Post Patron

Sync Y Axis

hello all, any ideas what DAXi could use to sync the two y Axis on the following charts. the data comes from two different tables.

 

i guess I want to find the max value of the max month from both charts.

 

Capture.PNG

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

Hi  @NewbieJono ,

 

Here are the steps you can follow:

1. Create calculated table.

Table =
var _table1=
SUMMARIZE(
'Table1',Table1[Date],"Value",SUMX(FILTER(ALL(Table1),YEAR('Table1'[Date])=YEAR(EARLIER('Table1'[Date]))&&MONTH('Table1'[Date])=MONTH(EARLIER('Table1'[Date]))),[Value1]),"Table","Table1")
    var _table2=
SUMMARIZE(
'Table2',Table2[Date],"Value",SUMX(FILTER(ALL(Table2),YEAR('Table2'[Date])=YEAR(EARLIER('Table2'[Date]))&&MONTH('Table2'[Date])=MONTH(EARLIER('Table2'[Date]))),[Value2]),"Table","Table2")
var _table3=
UNION(_table1,_table2)
var _table4=
FILTER(
    _table3,
   [Value]=MAXX(FILTER(_table3,[Table]=EARLIER([Table])&&YEAR([Date])=YEAR(EARLIER([Date]))),[Value]))
return
_table4

2. Create measure.

Flag =
var _column1=SELECTCOLUMNS(FILTER('Table','Table'[Table]="Table1"),"1",[Date])
var _column2=SELECTCOLUMNS(FILTER('Table','Table'[Table]="Table2"),"2",[Date])
return
    IF(
    NOT(MAX('Table2'[Date])) in _column2,1,
    IF(
    NOT(MAX('Table1'[Date])) in _column1 ,0,1)
)

3. Set [Flag] to is=1 in Table 1 and set [Flag] to is=0 in Table2.

vyangliumsft_0-1688451479468.png

 

vyangliumsft_1-1688451479474.png

4. Result:

vyangliumsft_2-1688451540475.png

 

Best Regards,

Liu Yang

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

View solution in original post

3 REPLIES 3
v-yangliu-msft
Community Support
Community Support

Hi  @NewbieJono ,

 

Here are the steps you can follow:

1. Create calculated table.

Table =
var _table1=
SUMMARIZE(
'Table1',Table1[Date],"Value",SUMX(FILTER(ALL(Table1),YEAR('Table1'[Date])=YEAR(EARLIER('Table1'[Date]))&&MONTH('Table1'[Date])=MONTH(EARLIER('Table1'[Date]))),[Value1]),"Table","Table1")
    var _table2=
SUMMARIZE(
'Table2',Table2[Date],"Value",SUMX(FILTER(ALL(Table2),YEAR('Table2'[Date])=YEAR(EARLIER('Table2'[Date]))&&MONTH('Table2'[Date])=MONTH(EARLIER('Table2'[Date]))),[Value2]),"Table","Table2")
var _table3=
UNION(_table1,_table2)
var _table4=
FILTER(
    _table3,
   [Value]=MAXX(FILTER(_table3,[Table]=EARLIER([Table])&&YEAR([Date])=YEAR(EARLIER([Date]))),[Value]))
return
_table4

2. Create measure.

Flag =
var _column1=SELECTCOLUMNS(FILTER('Table','Table'[Table]="Table1"),"1",[Date])
var _column2=SELECTCOLUMNS(FILTER('Table','Table'[Table]="Table2"),"2",[Date])
return
    IF(
    NOT(MAX('Table2'[Date])) in _column2,1,
    IF(
    NOT(MAX('Table1'[Date])) in _column1 ,0,1)
)

3. Set [Flag] to is=1 in Table 1 and set [Flag] to is=0 in Table2.

vyangliumsft_0-1688451479468.png

 

vyangliumsft_1-1688451479474.png

4. Result:

vyangliumsft_2-1688451540475.png

 

Best Regards,

Liu Yang

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

amitchandak
Super User
Super User

@NewbieJono , You need to have common date/dimension tables for that

 

Power BI- DAX: When I asked you to create common tables: https://youtu.be/a2CrqCA9geM
https://medium.com/@amitchandak/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-soluti...

 

Power BI- Power Query: When I asked you to create common tables: https://youtu.be/PqfGW6pl1Sw

 

Also check out

Power BI Field Parameters — A Quick way for Dynamic Visuals: https://amitchandak.medium.com/power-bi-field-parameters-a-quick-way-for-dynamic-visuals-fc4095ae9af...
Power BI Field Parameters- Measure Slicer and Axis/Dimension slicer: https://youtu.be/lqF3Wa1FllE

Sorry! i meant the X-axis!

 

so for the above charts I would need a max of 164

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.