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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Top Kudoed Authors