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

TOTAL SUM AND TOTAL COUNT OF A EXPRESSION WITH A SELECTED DAY

hi,

 

I need hope to solve this calculation:

Grid.PNG

 

 

 

Meet 50% is an expression : IF([SUM_RESULT]>5;1;0)

 

SUM_RESULT = calculate(sum(TABLE[RESULT_CONDIZIONE]);DATESBETWEEN(TABLE_CALENDAR[Day].[Date];TABLE[12_previous_month];TABLE[select_month]))

 

 

12_previous_month = IF(HASONEVALUE(TABLE_CALENDAR[Day]);DATEADD(VALUES(TABLE_CALENDAR[Day]);-12;MONTH))

 

select_month = SELECTEDVALUE(TABLE_CALENDAR[Day])

 

 

I would to read in the box TOTAL 50% the total of Meet 50% (in this ex.:5). 

I would to read in the box COUNT 50% the COUNT of values (in this ex.:14).

 

I try without success with:

 

TOTAL 50% = SUMX(TABLE;IF([SUM_RESULT]>5;1;0))

COUNT 50% = COUNTX(TABLE;IF([SUM_RESULT]>5;1;0))

 

 

Greetings ans thanks

Valentina

1 ACCEPTED SOLUTION

yesterday I risolved :

 

TOTAL 50%= 

    SUMX (
        SUMMARIZE( TABLE;

                               TABLE[n_PLA];

                               TABLE[KPI_DESCRIPTION];

                               "Meet 50%";IF([SUM_RESULT]>5;1;0)

              )
       ;  [Meet 50%]

)

 

COUNT 50%  = 

    COUNTX (
        SUMMARIZE( TABLE;

                               TABLE[n_PLA];

                               TABLE[KPI_DESCRIPTION];

                               "Meet 50%";IF([SUM_RESULT]>5;1;0)

                   )
       ;  [Meet 50%]

)

 

Regards thanks Valentina

 

 

View solution in original post

2 REPLIES 2
v-qiuyu-msft
Community Support
Community Support

Hi @vmontaldo,

 

From your description, both [SUM_RESULT] and [Meet 50%] are measures, right? As you don't provide sample data, I use some dummy data to test on my side.

 

1. You can create the measures below:
Total 50% = SUMX(Sheet1,Sheet1[Meet 50%])
Total count = COUNTX(Sheet1,Sheet1[Sum-result])

 

2.Create a table to add your [n_PLA], [Sum_result] and [Meet 50%] fields.

3.Create two Card visuals to show your [Total 50%] and [Total count] measure.

 

q5.jpg

Best Regards,

Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

yesterday I risolved :

 

TOTAL 50%= 

    SUMX (
        SUMMARIZE( TABLE;

                               TABLE[n_PLA];

                               TABLE[KPI_DESCRIPTION];

                               "Meet 50%";IF([SUM_RESULT]>5;1;0)

              )
       ;  [Meet 50%]

)

 

COUNT 50%  = 

    COUNTX (
        SUMMARIZE( TABLE;

                               TABLE[n_PLA];

                               TABLE[KPI_DESCRIPTION];

                               "Meet 50%";IF([SUM_RESULT]>5;1;0)

                   )
       ;  [Meet 50%]

)

 

Regards thanks Valentina

 

 

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.