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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
zgrshn
Regular Visitor

Opened closed dates

Hello

there are 3 columns in my Excel (Count , OpenedDate , ClosedDate)

2016-10-26_13-41-55.png

I want to create a dash on PowerBi Desktop like this ,


2016-10-26_13-36-39.png

 

How can I do it ?

1 ACCEPTED SOLUTION

Hi @zgrshn,

 

According to your description, I made a sample for your reference.

 

I assume you have a table called "MyTestTable" like below.

t1.PNG

1. Add a new table called "StatusTable".

t2.PNG

2. Use the formula below to create a calculate column called "Status" in "MyTestTable" table.

Status = IF(ISBLANK(MyTestTable[ClosedDate]), "Opened","Closed")

c1.PNG

3. Use the formula below to create a measure called "Value".

Value =
IF (
    ISBLANK (
        CALCULATE (
            COUNTROWS ( MyTestTable ),
            FILTER (
                MyTestTable,
                MyTestTable[Status] = FIRSTNONBLANK ( StatusTable[Status], 1 )
            )
        )
    ),
    IF (
        FIRSTNONBLANK ( StatusTable[Status], 1 ) = "Opened",
        SUM ( MyTestTable[Count] ),
        0
    ),
    SUM ( MyTestTable[Count] )
)

4. Use Matrix and Stacked column chart to show the data on the report.

report.PNG

Here is the sample pbix file for your reference.

 

Regards

View solution in original post

5 REPLIES 5
Greg_Deckler
Super User
Super User

Can you explain where the numbers are coming from in your result?


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

I write the numbers manually in Excel .

2016-10-26_13-41-55.png

 

2016-10-27_09-23-24.png

 

2016-10-27_09-23-48.png

 

 

Hi @zgrshn,

 

According to your description, I made a sample for your reference.

 

I assume you have a table called "MyTestTable" like below.

t1.PNG

1. Add a new table called "StatusTable".

t2.PNG

2. Use the formula below to create a calculate column called "Status" in "MyTestTable" table.

Status = IF(ISBLANK(MyTestTable[ClosedDate]), "Opened","Closed")

c1.PNG

3. Use the formula below to create a measure called "Value".

Value =
IF (
    ISBLANK (
        CALCULATE (
            COUNTROWS ( MyTestTable ),
            FILTER (
                MyTestTable,
                MyTestTable[Status] = FIRSTNONBLANK ( StatusTable[Status], 1 )
            )
        )
    ),
    IF (
        FIRSTNONBLANK ( StatusTable[Status], 1 ) = "Opened",
        SUM ( MyTestTable[Count] ),
        0
    ),
    SUM ( MyTestTable[Count] )
)

4. Use Matrix and Stacked column chart to show the data on the report.

report.PNG

Here is the sample pbix file for your reference.

 

Regards

@v-ljerr-msft

Really like what you've done, easy to understand.

 

Can you help a bit further with that formula (VALUE) if there are 4 status values? I don't have a count column, I just have a status column for each ticket with the following indicator: open, closed, pending and resolved.

(FYI-resolved and closed mean 2 different things)

 

Thank you in advance!

Dear JerryLi

Thank you very much 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors