Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi team
I have one table like below -
I want to create another calculated table like below-
In above table - I want another column showing the count of Pass/Fail accourding to given in DAX. How to get that column?
Please help.
@amitchandak Could you please look and help me.
Thanks and regards
RatanB
I am trying below but not happening -
Please advise
Try:
CountPassFail =
ADDCOLUMNS (
SUMMARIZE ( Data, Data[Region], Data[Sites], Data[Month] ),
"Fail", CALCULATE ( COUNT ( Data[Status] ), Data[Status] = "Fail" ),
"Pass", CALCULATE ( COUNT ( Data[Status] ), Data[Status] = "Pass" )
)
Proud to be a Super User!
Paul on Linkedin.
Thank you so much @PaulDBrown. it worked.
Could you please advise - incase I want to make separate measure in CountPassFaill Table -then why the same extract from count is not working?
The calculated column doesn't work because there is no filter context coming from the original table because they are not related. So the code in the new table is not identifying the context for the fields region, site and month from the original table. You can solve this by either creating dimension tables or using the TREATAS function.
Proud to be a Super User!
Paul on Linkedin.
HI @Anonymous
Can you share sample of your data here to be able to copy that? NOT IN IMAGE TYPE 🙂
Appreciate your Kudos !
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
30 | |
13 | |
11 | |
9 | |
6 |