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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Anonymous
Not applicable

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
)

 

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.