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
viveksharma21
Frequent Visitor

Can someone help with DAX Script?

Hello everyone, I am looking for some help in writting a DAX that will give me the following result:

 

Ideal result = calculate number of activity IDs that have changed status from Not Started to In Progress between Sep 15 and Sep 16.

 

Ideally i would like to compare this measure for more than two days and plot the measure over dates that are presneted in Column 1. 

 

Sample Dataset is here:

DateActivity IDActivity Status
15 sep 2021ANot Started
15 sep 2021   BNot Started
15 sep 2021   CNot Started
15 sep 2021   DIn Progress
15 sep 2021   EIn Progress
16 sep 2021   ANot Started
16 sep 2021   BIn Progress
16 sep 2021   CIn Progress
16 sep 2021   DIn Progress
16 sep 2021   EIn Progress
2 REPLIES 2
CNENFRNL
Community Champion
Community Champion

Status Transition = 
SUMX (
    DISTINCT ( INFO[Activity ID] ),
    0 + ( CALCULATE ( DISTINCTCOUNT ( INFO[Activity Status] ) ) > 1 )
)

Screenshot 2021-09-22 175226.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the link down below, that is the sample pbix file.

 

Picture1.png

 

Ideal result measure : =
VAR newtable =
ADDCOLUMNS (
VALUES ( Data[Activity ID] ),
"@statuschange",
CALCULATE (
IF (
COUNTROWS ( SUMMARIZE ( Data, Data[Activity ID], Data[Activity Status] ) ) > 1,
1
)
)
)
RETURN
SUMX ( newtable, [@statuschange] )

 

 

Link to the sample pbix file 

 

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


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.

Top Solution Authors