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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

DAX help

Hi had a dataset see the top part in below, and i want to achieve the calculation/measure in below.  please help. thanks. 

 

SP.PNG

1 ACCEPTED SOLUTION
prateekraina
Memorable Member
Memorable Member

Hi @Anonymous,

 

Here are the measures:

Total Active = 
CALCULATE (
    COUNT ( 'Table'[Customer] ),
    FILTER (
        ALL ( 'Table'),
        'Table'[Sign Up Date] <= MAX ( 'Table'[Sign Up Date] )
        && 'Table'[Status] = "Active"
    )
)


Cancelled Today =
IF (
    MAX ( 'Table'[Status] ) = "Cancelled",
    1,
    0
)


Cancelled % in Today =
DIVIDE (
    [Cancelled Today],
    [Total Active],
    0
)


Here is the screenshot:

Capture.PNG

 

Kindly accept my answer as solution if i have solved your problem. Also, don't forget to hit the thumbs up.

 

Prateek Raina

View solution in original post

2 REPLIES 2
Seward12533
Solution Sage
Solution Sage

Its not hard but you need to understand how PowerBI works and some simple dax but some complex concepts. First and foremost you need a date table or other table of unique sequential values) to take advantage of DAX Time Intelligence so you can do Cumulative functions Can't really take the time to explain so here is an example.

 

 

https://1drv.ms/u/s!AuCIkLeqFmlhhJh3pj3q9XzrxpxAng

 

capture20180803083150134.png

 

prateekraina
Memorable Member
Memorable Member

Hi @Anonymous,

 

Here are the measures:

Total Active = 
CALCULATE (
    COUNT ( 'Table'[Customer] ),
    FILTER (
        ALL ( 'Table'),
        'Table'[Sign Up Date] <= MAX ( 'Table'[Sign Up Date] )
        && 'Table'[Status] = "Active"
    )
)


Cancelled Today =
IF (
    MAX ( 'Table'[Status] ) = "Cancelled",
    1,
    0
)


Cancelled % in Today =
DIVIDE (
    [Cancelled Today],
    [Total Active],
    0
)


Here is the screenshot:

Capture.PNG

 

Kindly accept my answer as solution if i have solved your problem. Also, don't forget to hit the thumbs up.

 

Prateek Raina

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.