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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Hyen
Frequent Visitor

problem of dragging my measure on x-axis

Hi everyone,

 

I need to visualize the histogram in PowerBI, so I would like to use column chart.

But my measure can't be dragged on x-axis, which I want.

Do you have an idea how to do?

 

To understand easliy, I will post my measure.

 

Timeline Events After Opportunity Line Item Created =
VAR EarliestOpportunityLineItemCreated =
    CALCULATE(
        MIN('DIM_Event_Timeline'[Date and Timestamp]),
        FILTER(
            'DIM_Event_Timeline',
            'DIM_Event_Timeline'[Timeline Event] = "Opportunity Line Item Created"
        )
    )
    VAR countEvents =
    CALCULATE(
            COUNTROWS(
                SUMMARIZE(
                    FILTER(
                        'DIM_Event_Timeline',
                        'DIM_Event_Timeline'[Date and Timestamp] > EarliestOpportunityLineItemCreated &&
                        'DIM_Event_Timeline'[Timeline Event] <> "Opportunity Line Item Created"
                    ),
                    'DIM_Interactions'[Content Name],
                    'DIM_Event_Timeline'[Timeline Event]
                )
            )
        )
RETURN
    SWITCH(EarliestOpportunityLineItemCreated,
        BLANK(), BLANK(),
        SWITCH(
            countEvents,
            BLANK(), 0,
            countEvents
        )
    )

Thanks in advance!
2 REPLIES 2
Anonymous
Not applicable

Hi @Hyen ,

If what you are creating a measure [Timeline Events After Opportunity Line Item Created], then it can't be put on X-axis of column chart. The X-axis of a column chart is reserved for categorical data, such as product names, dates, or regions. Measures are used to aggregate numerical data, such as sales figures or customer counts, and are typically displayed on the Y-axis of a chart. If you want to display a measure on a column chart, you can use it as the value of the chart, which will be displayed on the Y-axis.

 

Could you please provide some raw data in your tables 'DIM_Interactions' and 'DIM_Event_Timeline' (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And it is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Hi Rena,

 

I can provide you with the tables, the relationships between them, and the expected result.

I cannot upload all the data columns here, and also I am not an expert in data modeling. Therefore, the tables I provide might be limited and unprofessional. However, I will do my best to explain my data and situation.

 

1. Tables

DIM_Event_Timeline

 

Timeline_EventTimeline_Category
A1
A2
A3
B1
B2
B3
B3
C2
C1

 

DIM_Interactions

 

Content Name
apple
banana
kiwi
peach
melon
mango
strawberry
watermelon

lemon

 

DIM_Contacts with Contact Campaign Involvement

 

E-MailCampaign_ID (CID)
adfafw@gmail.comA1
asdf234@gmail.comC1
grtw2iu@gmail.comB2
ergear2@naver.comB2
hrtowuhfah@naver.comB1
uwfhuy5@fau.deC2
agerhbiub@google.comA2
htrudf3@google.comA1
dguhbvu47y@powerbi.comC1

 

2. Relationship between tables

 

DIM_Event_Timeline : DIM_Interactions = * : 1 (key: INTERACTION _UID)

DIM_Event_Timeline : DIM_Contacts with Contact Campaign Involvement = * : * (key: CONTACT_UID)

 

3. The measures I created

 

Timeline Events Before Opportunity Line Item Created =
VAR EarliestOpportunityLineItemCreated =
    CALCULATE(
        MIN('DIM_Event_Timeline'[Date and Timestamp]),
        FILTER(
            'DIM_Event_Timeline',
            'DIM_Event_Timeline'[Timeline Event] = "Opportunity Line Item Created"
        )
    )
    VAR countEvents =
    CALCULATE(
        COUNTROWS(
            SUMMARIZE(
                FILTER(
                    'DIM_Event_Timeline',
                    'DIM_Event_Timeline'[Date and Timestamp] < EarliestOpportunityLineItemCreated &&
                    'DIM_Event_Timeline'[Timeline Event] <> "Opportunity Line Item Created"),
                'DIM_Interactions'[Content Name],
                'DIM_Event_Timeline'[Timeline Event]
            )
        )
    )
RETURN
    SWITCH(EarliestOpportunityLineItemCreated,
        BLANK(), BLANK(),
        SWITCH(
            countEvents,
            BLANK(), 0,
            countEvents
        )
    )

 

Timeline Events After Opportunity Line Item Created =
VAR EarliestOpportunityLineItemCreated =
    CALCULATE(
        MIN('DIM_Event_Timeline'[Date and Timestamp]),
        FILTER(
            'DIM_Event_Timeline',
            'DIM_Event_Timeline'[Timeline Event] = "Opportunity Line Item Created"
        )
    )
    VAR countEvents =
    CALCULATE(
            COUNTROWS(
                SUMMARIZE(
                    FILTER(
                        'DIM_Event_Timeline',
                        'DIM_Event_Timeline'[Date and Timestamp] > EarliestOpportunityLineItemCreated &&
                        'DIM_Event_Timeline'[Timeline Event] <> "Opportunity Line Item Created"
                    ),
                    'DIM_Interactions'[Content Name],
                    'DIM_Event_Timeline'[Timeline Event]
                )
            )
        )
RETURN
    SWITCH(EarliestOpportunityLineItemCreated,
        BLANK(), BLANK(),
        SWITCH(
            countEvents,
            BLANK(), 0,
            countEvents
        )
    )
 
I created these two measures in DIM_Event_Timeline
 

4. expected result

The histogram what I wants to visualize is this histogram which contains the number of Touchpoint (TP) on the x-axis (the measures I created) and the count of email on the y-axis.

I also would like to use slicer (for example, Campaign_ID (CID)) to filter the data.

 
BQ_3.jpeg
 
TP = Touchpoint = the measures I created
 
Thank you in adcanve for your assistance.
Hyeeun

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors