Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
i have lets say 5 centers in monthly basis with data about clients and some of them doesnt appear in some months i want to count them and put them in a table to know which centers of those doesnt have any data in that month and ofcourse i have to count them as distinct can i do this ? im a beginner in dax and power bi
Ex. centers
alquds center
alsuwaidi center
alarid center
alhilal center
alrabwah center
Solved! Go to Solution.
Hi @abodqm ,
Suppose we have:
Please try like:
Measure =
VAR _cur_month_number = SELECTEDVALUE('Table'[Month])
VAR _centers_before = CALCULATETABLE(VALUES('Table'[centers]),'Table'[Month]<_cur_month_number)
VAR _result = IF(ISBLANK(_cur_month_number),"Please choose a month",CALCULATE(DISTINCTCOUNT('Table'[centers]),NOT 'Table'[centers] IN _centers_before))
RETURN
_result
Output:
check the pbix file.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
could you pls provide some sample data and expected output?
Proud to be a Super User!
look here 5 centers in feb second photo there is one center how do i know the rest that doesn't have any data in a list can i do somthing to make them in every month show me the one's with no data
pls try
DISTINCTCOUNT(centers)
DISTINCTCOUNT function (DAX) - DAX | Microsoft Learn
Proud to be a Super User!
bro i am using distinct count
Hi @abodqm ,
Suppose we have:
Please try like:
Measure =
VAR _cur_month_number = SELECTEDVALUE('Table'[Month])
VAR _centers_before = CALCULATETABLE(VALUES('Table'[centers]),'Table'[Month]<_cur_month_number)
VAR _result = IF(ISBLANK(_cur_month_number),"Please choose a month",CALCULATE(DISTINCTCOUNT('Table'[centers]),NOT 'Table'[centers] IN _centers_before))
RETURN
_result
Output:
check the pbix file.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group
User | Count |
---|---|
96 | |
85 | |
77 | |
66 | |
63 |
User | Count |
---|---|
110 | |
96 | |
96 | |
67 | |
59 |