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

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.

Reply
trevordunham
Helper III
Helper III

Column filter by different months same table

I have a calculated field that averages scores. I want to create columns that return the score for january/february so I can have the Jan score, feb score and YTD score all within the same table visual.

 

I tried to do a simple IF(month([date])=1,[score]) = Jan score. But it wont let me return my score column in this calculation.

 

Any other thoughts or easier ways of going about this?

1 ACCEPTED SOLUTION
v-jianpeng-msft
Community Support
Community Support

Hi, @trevordunham 

I'm happy to answer your questions. Based on your description, I used the following sample data:

1.png

We now need the score columns corresponding to January and February. We can use the SUMMARIZE function to group the dates.

2.png

Use the above function to create two new tables, containing the score columns for January and February respectively.

Table DAX formula:

 

Table = CALCULATETABLE(SUMMARIZE('Sheet2','Sheet2'[name],'Sheet2'[score],'Sheet2'[date]),MONTH('Sheet2'[date])=1)

 

The results are as follows:

3.png

Table2 DAX formula:

 

Table2 = CALCULATETABLE(SUMMARIZE('Sheet2','Sheet2'[name],'Sheet2'[score],'Sheet2'[date]),MONTH('Sheet2'[date])=2)

 

The results are as follows:

4.png

Create relationships into two new tables:

5.png

Use January and February score columns in table visual

6.png

To learn how to use the SUMMARIZE function, you can click on the link: https://dax.guide/summarize/

I have provided the sample PBIX file used this time below. If the above suggestions are helpful to you, that would be great.

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-jianpeng-msft
Community Support
Community Support

Hi, @trevordunham 

I'm happy to answer your questions. Based on your description, I used the following sample data:

1.png

We now need the score columns corresponding to January and February. We can use the SUMMARIZE function to group the dates.

2.png

Use the above function to create two new tables, containing the score columns for January and February respectively.

Table DAX formula:

 

Table = CALCULATETABLE(SUMMARIZE('Sheet2','Sheet2'[name],'Sheet2'[score],'Sheet2'[date]),MONTH('Sheet2'[date])=1)

 

The results are as follows:

3.png

Table2 DAX formula:

 

Table2 = CALCULATETABLE(SUMMARIZE('Sheet2','Sheet2'[name],'Sheet2'[score],'Sheet2'[date]),MONTH('Sheet2'[date])=2)

 

The results are as follows:

4.png

Create relationships into two new tables:

5.png

Use January and February score columns in table visual

6.png

To learn how to use the SUMMARIZE function, you can click on the link: https://dax.guide/summarize/

I have provided the sample PBIX file used this time below. If the above suggestions are helpful to you, that would be great.

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors