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
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?


@ 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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.