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
PrivateAnalytic
Helper IV
Helper IV

DAX Formula and Measure Question

Hello everyone! My data is depicted below (1st picture). It is pretty simple, I created the Total Subtasks Completed and the % of PP Progress columns. The total subtasks completed is the sum of the all the different subtask result columns, and the % of PP progress uses the values in the Total Subtasks completed columns divided by 17 because thats how many different subtasks there are. On the second picture I attached, I made a quick table visual which shows how many subtasks and their % of PP progress a person has. I was looking to create a measure or column which can bucket the % of PP Progress into a 25% bucket. Such as those between 0 and 25% are in 1, 26-50% in another, 51-75% in a third, and lastly 76-100%. Is there a DAX Calculation I can use to make this successful?

PrivateAnalytic_0-1668531540573.png

PrivateAnalytic_1-1668531723496.png

 

1 ACCEPTED SOLUTION
FreemanZ
Super User
Super User

Supposing your table named Data, try to add a column with the code below:
PctRange =
SWITCH(
    TRUE(),
    Data[% of PP Progress] <=0.25, "0-25%",
    Data[% of PP Progress] <=0.5, "26%-50%",
    Data[% of PP Progress] <=0.75, "51%-75%",
    "76%-100%"
)

View solution in original post

6 REPLIES 6
v-jayw-msft
Community Support
Community Support

Hi @PrivateAnalytic ,

 

Try a measure like below:

Measure =
var %Progress = sum([% of PP Progress])
Return
SWITCH(
    TRUE(),
    %Progress <= 0.25, 1,
    %Progress > 0.25 && %Progress < = 0.5, 2,
    %Progress > 0.5 && %Progress <=0.75, 3,
    4
)

 

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
FreemanZ
Super User
Super User

Supposing your table named Data, try to add a column with the code below:
PctRange =
SWITCH(
    TRUE(),
    Data[% of PP Progress] <=0.25, "0-25%",
    Data[% of PP Progress] <=0.5, "26%-50%",
    Data[% of PP Progress] <=0.75, "51%-75%",
    "76%-100%"
)

I got this error when I tried it <ccon>A circular dependency was detected: PP-Task Completion[% of PP Progress], PP-Task Completion[PctRange], PP-Task Completion[% of PP Progress].</ccon>

Rewrite your column as below:
% of PP Progress =
CALCULATE(
    DIVIDE(Data[Total Subtasks completed],17),
    ALLEXCEPT (Data[Total Subtasks completed])
)
Syk
Super User
Super User

You can group your data without DAX! Click the column you're wanting to group and under column tools > data groups > New data groups

Syk_0-1668532439368.png


Then you can toss those %s in buckets

I never knew this! When I tried to do it, I got this popup which I've never seen before. 

PrivateAnalytic_0-1668544621708.png

 

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