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
jorismo
Helper II
Helper II

Count values depending on a condition

Hi all,

 

my next question 🙂

 

I've got a table with dates and available status (1 and 0.5).

 

What I want to achieve is when I plot the values in an area chart I see that on the 4the of january, 4.5 persons were available. On the 5th 8 persons were available.

 

First Login                        Total Time             Available Day

Screenshot_4.png

 

In first case I was thinking to use the countRow function but that would be a problem because the 0.5 (half day) wouldn't be counted correctly (would be counted as 1)

 

Thanks again

1 ACCEPTED SOLUTION

Hi @MFelix,

 

Maybe you can try to use summarize function to create a summary table:

Table = SUMMARIZE(Table1,[Date],"Total Day",SUM(Table1[Avaliable Days]))

17.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

HI @jorismo

 

If you use numeric value to record available days, I think you can use sum function to get the total available days. 

 

Sample:

Total available days =
CALCULATE (
    SUM ( table[avaliable days] ),
    FILTER ( ALL ( table ), table[First login] = MAX ( table[First login] ) )
)

 

In addition, you can also add filters to calculate with available day as the parameter of calculation. ( countrows *1 + countrows * 0.5)

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi I can't get it working.

 

The result that i want is that I can plot this to an area chart where also some kpi's are shown.

 

Result:

First login                 Available

4/01/2017                  4,5

5/01/2017                  8

 

Hope that you can give me some more advice thanks!

Hi @MFelix,

 

Maybe you can try to use summarize function to create a summary table:

Table = SUMMARIZE(Table1,[Date],"Total Day",SUM(Table1[Avaliable Days]))

17.PNG

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
MFelix
Super User
Super User

Hi @jorismo,

 

Just do the sum on available day, should give you what you need.

 

Regards,

 

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.