Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Merge in a single Line Chart two visuals with different dates columns


Dear PowerBi Community,

I would like to share you a problem that I'm facing right now:

I have two differents columns dates (IFD Actual and IFD Planned) that after counting them  (Dax formule in the 3rd picture), I would like to show in the same graph as I was capable to do in Excel. I tried to use one unique calendar table with USERELATIONSHIP without any particular success. Last remark: the two graphs separetely show the correct information as you may see in the second picture.

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    I suggest you to create a virtual table in var and then calculate the running total.

    My measure:

    IFD_Actual = 
    VAR _VIRTUAL_TABLE =
        ADDCOLUMNS (
            ALL ( 'Date 1' ),
            "TEST",
                CALCULATE (
                    COUNT ( 'MODEL 60'[IFD Actual] ),
                    USERELATIONSHIP ( 'MODEL 60'[IFD Actual], 'Date 1'[Date] )
                )
        )
    RETURN
        SUMX ( FILTER ( _VIRTUAL_TABLE, [Date] <= MAX ( 'Date 1'[Date] ) ), [TEST] )

    In my sample, [Date] column in my table visual is from 'Date 1'. So the filter in sumx is [Date] (from virtual table) <= MAX('Date1'[Date]).

    Note: We need to add the [Date] column in table visual in Max field in sumx filter.

    Best Regards,
    Rico Zhou

     

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

4 Replies