Reply
jaspreet27singh
Frequent Visitor

count of days if revenue = 0 / sum of days passed in the month * 100

I have two tables in data model

table one - calendar 

table two - facts

 

I want create a measure-  count of days if revenue = 0 / sum of days passed in the month * 100 

 

 

1 ACCEPTED SOLUTION
Dangar332
Super User
Super User

hi, @jaspreet27singh 

try below code it might work

if revenue is measure then try below

measure=
calculate(
   count(table[date]),
   filter(
     facttable,[revenue]=0
)

 

if still not work then provide some sample data 

View solution in original post

2 REPLIES 2
v-zhouwen-msft
Community Support
Community Support

Hi @Dangar332 ,thanks for the quick reply.

Hi @jaspreet27singh ,

The Table data is shown below:

vzhouwenmsft_0-1711355671521.png

Please follow these steps:
1. Use the following DAX expression to create a measure('DAY(TODAY())': Indicates how many days have passed in the month)

Measure = DIVIDE(
    CALCULATE(COUNT(Table2[Amount]),'Table2'[Amount] = 0),
    DAY(TODAY()) * 100)

2. Final output

vzhouwenmsft_1-1711356218080.png

 

Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Dangar332
Super User
Super User

hi, @jaspreet27singh 

try below code it might work

if revenue is measure then try below

measure=
calculate(
   count(table[date]),
   filter(
     facttable,[revenue]=0
)

 

if still not work then provide some sample data 

avatar user

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)