Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have an Access database that I have imported into Power BI. I have an "Event" table with fields [EventID], [Year], [Style], [Distance], etc. It is joined to a "Results" table with fields [EventID], [Name], etc.
I have four DAX measures to count participations for each [Name] in four categories: (Long FR, Long CL, Middle FR, Middle FR):
Long CL Participations = CALCULATE(COUNTROWS(Results),Event[Style]="CL",Event[Distance]="Long")
Long FR Participations = CALCULATE(COUNTROWS(Results),Event[Style]="FR",Event[Distance]="Long")
Middle CL Participations = CALCULATE(COUNTROWS(Results),Event[Style]="CL",Event[Distance]="Middle")
Middle FR Participations = CALCULATE(COUNTROWS(Results),Event[Style]="FR",Event[Distance]="Middle")
and then I use:
Total Participations = COUNTROWS(Results)
to get a Total Participations for each [Name].
However I need a DAX measure to count for each [Name] how many Long CL and Long FR events in the same Year they have done. Can you suggest a solution?
Solved! Go to Solution.
Problem solved,
I found a solution. I created two queries and then merged them on on only the matching fields.
Thanks, RonaldF
@RonaldF,
Could you please share sample data of the two tables(Event and Results) and post expected result in table?
We also need to know what specific fields you use to create relationship between Event and Results.
Regards,
Lydia
Problem solved,
I found a solution. I created two queries and then merged them on on only the matching fields.
Thanks, RonaldF
Hi,
I suggest that you create slicers from the Event table for Style and Distance. Simplify your formula to:
=COUNTROWS(Results)
As long as your datasets have a proper relationship, you should now be able to slice your visual by any attribute.
Hello Ashish,
Thanks for your suggestion. I have tried slicers, but what I was trying to do was add a column into my table.
In Access I made two queries: (Count Long FR) and (Count Long CL) and then joined them where [Year] = [Year]
Thanks,
RonaldF
Hi,
I am sorry but i cannot appreicate why you need a calculated column when a calculated field (measure) and slicer can solve your problem. May be i am not understanding your question.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
94 | |
88 | |
32 | |
28 |
User | Count |
---|---|
153 | |
101 | |
82 | |
63 | |
52 |