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.
1. I want to count "every date" by "each country" when "Confirmed column is nonblank or >0". In excel file we can do it by countifs function. What would be the Dax formula for this solution?
Date | Confirmed | Recovered | Deaths | Day of Year | Province | Country | Corona Days (Expected Result) |
22-01-20 | 5 | Bangladesh | 1 | ||||
22-01-20 | Sweden | 0 | |||||
22-01-20 | US | 0 | |||||
22-01-20 | UK | 0 | |||||
22-01-20 | 417 | India | 1 | ||||
22-01-20 | 694 | Italy | 1 | ||||
22-01-20 | 411 | Denmark | 1 | ||||
23-01-20 | 229 | Norway | 1 | ||||
23-01-20 | 146 | UAE | 1 | ||||
23-01-20 | 265 | Bangladesh | 2 | ||||
23-01-20 | 388 | Mali | 1 | ||||
23-01-20 | 358 | Italy | 2 | ||||
24-01-20 | 599 | UK | 2 | ||||
24-01-20 | 371 | Bangladesh | 3 | ||||
24-01-20 | 776 | Sweden | 1 |
Solved! Go to Solution.
Hi @harshnathani :
Kudos and Thanks a lot for your support. Finally I have got my expected result by the following formula:
Hi @Anonymous ,
You can try
DC =
CALCULATE (
DISTINCTCOUNT ( 'Table'[Date] ),
FILTER (
ALLEXCEPT (
'Table',
'Table'[Country]
),
'Table'[Confirmed] > 0
|| NOT (
ISBLANK ( 'Table'[Country] )
)
)
)
Pls share sample data in text format incase this does not work
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi Harshnathani: This DAX returning the total days for a country. But I am expecting to get the number of days as I have updated in another table. (after pasting the table the date column is getting distorted 😞 )
Hi @Anonymous ,
Please create a measure
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @harshnathani : Appreciate your faster supports. But seems I am not yet getting expected value. Its same value coming in every cell 😞
@Anonymous ,
Can you share expected output.
I had shared the formula for a measure.
Regards,
Harsh Nathani
Hi @Anonymous ,
Missed replying back yesteday, had an electricity outage.
Here are your results.
Create a new Calculated Column.
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @Anonymous ,
And incase you want 0's in front of Sweden,US,UK.
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi @harshnathani :
Kudos and Thanks a lot for your support. Finally I have got my expected result by the following formula:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
49 | |
26 | |
21 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
44 | |
19 | |
18 |