Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Need something like this.... maybe a SWITCH statement? Any help?
I have a Date Table with the Current Year and Quarters.
I have my dataset that has a relationship with the date table.
I have a drop down with the Quarters for this year, Q1 - Q4.
However, when I select Q1, not only does it return Q1, it also returns the blanks in my table.
How can I prevent this from happening?
If I have it filtered on Q1, I only want to see Q1 data in the table.
A couple things I tried,
I tried including the SOS date on the dropdown slicer and set it to is not blank.
I tried creating a measure and applied it to the table and set it to 1 so that if the dropdown was filtered, it would only show filtered data.
None of this works... any ideas?
PS- I should also mention, if there is not a date in that specific column in my table (i.e. if it is blank), and if it the quarter is not filtered - I still want to see those rows because there is value to see a date is not yet assigned. Just want to throw that in there because the fix is not to exclude those rows from my dataset. 🙂
shows blanks too-
This only shows filtered data. But requires selection to show data
myCONDITIONS_current_calendar =
var selected_qtr = SELECTEDVALUE('CurrentYearOnlyCalendar'[Quarter Calendar Year])
VAR conditionsmetcurrent =if(MIN('PCMerge'[dsbp_initiative_start_of_shipment]) <> BLANK() && ISFILTERED('CurrentYearOnlyCalendar'[Quarter Calendar Year]), 1, 0)
RETURN
conditionsmetcurrent
This kinda works but not fully
myCONDITIONS_current_calendar =
IF(MIN('PCMerge'[dsbp_initiative_start_of_shipment]) <> BLANK(),
SWITCH( TRUE(),
ISFILTERED('CurrentYearOnlyCalendar'[Quarter Calendar Year]), 1,
ISFILTERED('SOSCalendar'[FY Quarter]), 2, 3), 3)
Solved! Go to Solution.
Hi @NeverGiveUp ,
Please update the formula of measure [myCONDITIONS_current_calendar] as below and check if it can return the expected result...
myCONDITIONS_current_calendar =
VAR selected_qtr =
ISFILTERED ( 'CurrentYearOnlyCalendar'[Quarter Calendar Year] )
VAR selected_fyqtr =
ISFILTERED ( 'SOSCalendar'[FY Quarter] )
VAR sosdate =
SELECTEDVALUE ( 'PCMerge'[dsbp_initiative_start_of_shipment] )
RETURN
IF ( NOT ( ISBLANK ( sosdate ) ) && ( selected_qtr || selected_fyqtr ), 1, 0 )
If the above one can't help you, please provide some raw data in your tables 'CurrentYearOnlyCalendar','PCMerge' and 'SOSCalendar' (exclude sensitive data) with Text format and your expected result with backend logic and special examples? By the way, is there any relationship among these three tables? If yes, please also provide the related info. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
Hi @NeverGiveUp ,
Please update the formula of measure [myCONDITIONS_current_calendar] as below and check if it can return the expected result...
myCONDITIONS_current_calendar =
VAR selected_qtr =
ISFILTERED ( 'CurrentYearOnlyCalendar'[Quarter Calendar Year] )
VAR selected_fyqtr =
ISFILTERED ( 'SOSCalendar'[FY Quarter] )
VAR sosdate =
SELECTEDVALUE ( 'PCMerge'[dsbp_initiative_start_of_shipment] )
RETURN
IF ( NOT ( ISBLANK ( sosdate ) ) && ( selected_qtr || selected_fyqtr ), 1, 0 )
If the above one can't help you, please provide some raw data in your tables 'CurrentYearOnlyCalendar','PCMerge' and 'SOSCalendar' (exclude sensitive data) with Text format and your expected result with backend logic and special examples? By the way, is there any relationship among these three tables? If yes, please also provide the related info. It would be helpful to find out the solution. You can refer the following link to share the required info:
How to provide sample data in the Power BI Forum
And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.
How to upload PBI in Community
Best Regards
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
65 | |
63 | |
52 | |
37 | |
36 |
User | Count |
---|---|
79 | |
67 | |
60 | |
45 | |
45 |